Cron.php 805 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Passport\Lib;
  3. use Dever;
  4. class Cron
  5. {
  6. # 定时合并
  7. public function combine()
  8. {
  9. $combine = Dever::project('combine');
  10. if ($combine) {
  11. $where['status'] = 1;
  12. $data = Dever::db('passport/combine')->state($where);
  13. if ($data) {
  14. foreach ($data as $k => $v) {
  15. $drop = implode(',', $v['old_uid']);
  16. Dever::load('combine/lib/core.handle?uid=' . $v['new_uid'] . '&drop=' . $drop);
  17. $update['where_id'] = $v['id'];
  18. $update['status'] = 2;
  19. Dever::db('passport/combine')->update($update);
  20. }
  21. }
  22. //Dever::daemon('lib/core.handle?uid=' . $cur . '&drop=' . $drop, 'combine');
  23. }
  24. return 'ok';
  25. }
  26. }