where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); // halt($all); $all=TaskSchedulingPlan::whereDay('end_time')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); foreach($all as $k=>$v){ queue(TaskInformationJob::class,$v); } halt(1); } public function ceshi(){ $time=strtotime(date('Y-m-d')); // $time=strtotime(date('Y-m-d')); // $tiem_end=$time+86399; $all=TaskTemplate::where('cron_time','<',$time)->where('status',1)->with('company')->select()->toArray(); // $all=TaskTemplate::where('id',73)->with('company')->select()->toArray(); // $all=TaskSchedulingPlan::where('start_time','between',[$time,$tiem_end])->where('is_execute',0)->with(['template_info','scheduling'])->select()->toArray(); $company_id=0; foreach($all as $k=>$v){ TaskLogic::CronAdd($v); $company_id=$v['company_id']; } } public function ceshi1(){ $params=[ 'car_id'=>3, 'start_time'=>'2023-08-18', 'end_time'=>'2023-08-18 23:59:59' ]; $task=Task::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){ Task::where('id',$v['id'])->update(['status'=>3]); } } } } }