MaintainUserSign.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. 维护签到交互表
  4. */
  5. namespace App\Console\Commands\Tool;
  6. use App\Modules\User\Models\TempsUserSign;
  7. use App\Modules\User\Models\SmartPushUserSign;
  8. use Log;
  9. use Illuminate\Console\Command;
  10. use DB;
  11. class MaintainUserSign extends Command
  12. {
  13. /**
  14. * 执行命令 MaintainUserSign
  15. *
  16. * The name and signature of the console command.
  17. *
  18. * @var string
  19. */
  20. protected $signature = 'MaintainUserSign';
  21. /**
  22. * The console command description.
  23. *
  24. * @var string
  25. */
  26. protected $description = '维护签到交互表';
  27. /**
  28. * Execute the console command.
  29. *
  30. * @return mixed
  31. */
  32. public function handle()
  33. {
  34. ini_set('memory_limit', '1024M');
  35. print_r('memory_used:'.memory_get_usage()."\n");
  36. print_r("======维护签到交互表【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  37. $smart_push_end_time = date('Y-m-d 00:00:00',strtotime('- 3 day'));
  38. $temp_end_time = date('Y-m-d 00:00:00',strtotime('- 60 day'));
  39. \Log::info('MaintainUserSign_start:smart_push_end_time:'.$smart_push_end_time.' temp_end_time:'.$temp_end_time);
  40. SmartPushUserSign::deleteSmartPushUserSignByTime($smart_push_end_time);
  41. //TempsUserSign::deleteTempsUserSignByTime($temp_end_time);
  42. \Log::info('MaintainUserSign_end');
  43. print_r("======维护签到交互表 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  44. print_r('memory_used:'.memory_get_usage()."\n");
  45. }
  46. }