1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace app\cron;
- use app\common\util\AppMsg;
- use app\temperature\controller\Push;
- use think\Db;
- use yunwuxin\cron\Task;
- class TemperatureDevice extends Task
- {
- public function configure()
- {
- $this->everyMinute(); //每分钟执行一次
- }
- /**
- * 执行任务
- * @return mixed
- */
- protected function execute()
- {
- try{
- $tem = new Push();
- $tem->getDeviceData();
- $tem->clearData();
- }catch (\Exception $e){
- trace($e->getMessage());
- }
- }
- }
|