12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\cron;
- use yunwuxin\cron\Task;
- //近12个小时的绿化养护任务加入到任务栏
- class GreenTask extends Task
- {
- public function configure()
- {
- $this->everyMinute(); //每分钟执行一次
- }
- /**
- * 执行任务
- * @return mixed
- */
- protected function execute()
- {
- try{
- (new \app\common\model\GreenTask())->addGreenTask();
- }catch (\Exception $e){
- trace($e->getMessage());
- }
- }
- }
|