调试任务下发

This commit is contained in:
chenbo 2023-09-19 14:58:52 +08:00
parent 1d3aae45e7
commit 051ca65021

View File

@ -153,7 +153,7 @@ class CeshiController extends BaseApiController
{
$time = strtotime(date('Y-m-d'));
// $tiem_end=$time+86399;
$plan_all = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->with('company_info')->select()->toArray();
$plan_all = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->where('company_type', 18)->with('company_info')->select()->toArray();
$plan_ids = [];
foreach ($plan_all as $k => $v) {
@ -165,15 +165,15 @@ class CeshiController extends BaseApiController
unset($plan_all[$k]);
}
}
$company_id = [];
foreach ($plan_all as $k => $v) {
foreach ($v['template'] as $kk => $vv) {
TaskLogic::CronAdd($vv,$v);
queue(TaskAdd::class,['data'=>$vv,'data_two'=>$v]);
}
$company_id[] = $v['company_id'];
}
Company::where('id', 'in', $company_id)->inc('day_count')->update();
TaskScheduling::where('id', 'in', $plan_ids)->update(['cron_time' => time()]);
Log::info('定时任务下发执行成功' . date('Y-m-d H:i:s'));
}
}