WokerTask/app/task/TaskComplete.php

36 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2023-12-27 14:06:33 +08:00
<?php
namespace app\task;
use app\common\model\task\Task as TaskTask;
use yunwuxin\cron\Task;
class TaskCron extends Task{
public function configure()
{
$this->everyTenMinutes();
// $this->everyMinute();
}
/**
* 执行任务
* @return mixed
*/
protected function execute()
{
//任务下发
$task=TaskTask::where('id',487)->select()->toArray();
// foreach($task as $k=>$v){
// if(isset($v['extend']['terminus']['lnglat'])&& isset($v['extend']['transfer']['lnglat'])){
// $arr=$v['extend']['terminus']['lnglat'];
// $a=app(RemoteController::class)->coordinate($params,$arr[0],$arr[1]);
// $arr_two=$v['extend']['transfer']['lnglat'];
// $b=app(RemoteController::class)->coordinate($params,$arr_two[0],$arr_two[1]);
// if($a<500 && $b<500){
// TaskTask::where('id',$v['id'])->update(['status'=>3]);
// }
// }
// }
//...具体的任务执行
}
}