ConveyCron.php 463 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\cron;
  3. use app\common\util\AppMsg;
  4. use think\Db;
  5. use yunwuxin\cron\Task;
  6. class ConveyCron extends Task
  7. {
  8. public function configure()
  9. {
  10. $this->dailyAt("00:00"); //每天执行一次
  11. }
  12. /**
  13. * 执行任务
  14. * @return mixed
  15. */
  16. protected function execute()
  17. {
  18. try{
  19. model("ConveyCron")->plan();
  20. }catch (\Exception $e){
  21. trace($e->getMessage());
  22. }
  23. }
  24. }