更新
This commit is contained in:
parent
87b9e0a9f9
commit
d522bfe816
@ -28,14 +28,14 @@ class TaskCron extends Task{
|
|||||||
// $tiem_end=$time+86399;
|
// $tiem_end=$time+86399;
|
||||||
$all=TaskTemplate::where('cron_time','<',$time)->where('status',1)->with('company')->select()->toArray();
|
$all=TaskTemplate::where('cron_time','<',$time)->where('status',1)->with('company')->select()->toArray();
|
||||||
// $all=TaskSchedulingPlan::where('start_time','between',[$time,$tiem_end])->where('is_execute',0)->with(['template_info','scheduling'])->select()->toArray();
|
// $all=TaskSchedulingPlan::where('start_time','between',[$time,$tiem_end])->where('is_execute',0)->with(['template_info','scheduling'])->select()->toArray();
|
||||||
$company_id=0;
|
$company_id=[];
|
||||||
foreach($all as $k=>$v){
|
foreach($all as $k=>$v){
|
||||||
queue(TaskAdd::class,$v);
|
queue(TaskAdd::class,$v);
|
||||||
$company_id=$v['company_id'];
|
$company_id[]=$v['company_id'];
|
||||||
}
|
}
|
||||||
if($company_id!=0){
|
$arr=array_unique($company_id);
|
||||||
|
if(count($arr)){
|
||||||
Company::where('id',$company_id)->inc('day_count')->update();
|
Company::where('id','in',$arr)->inc('day_count')->update();
|
||||||
}
|
}
|
||||||
Log::error('定时任务下发执行成功'.date('Y-m-d H:i:s'));
|
Log::error('定时任务下发执行成功'.date('Y-m-d H:i:s'));
|
||||||
//...具体的任务执行
|
//...具体的任务执行
|
||||||
|
Loading…
x
Reference in New Issue
Block a user