diff --git a/app/api/controller/CronController.php b/app/api/controller/CronController.php index e25db3568..f03ae6d10 100644 --- a/app/api/controller/CronController.php +++ b/app/api/controller/CronController.php @@ -23,7 +23,14 @@ class CronController extends BaseApiController * 结算 */ public function settlement(){ - $all=TaskSchedulingPlan::where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); +// $all=TaskSchedulingPlan::where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); + $all = TaskSchedulingPlan::whereDay('end_time','yesterday') + ->withJoin(['scheduling'], 'left') + ->where('scheduling.company_type', 18) + ->where('is_pay',0) + ->with(['template_info']) + ->select() + ->toArray(); foreach($all as $k=>$v){ queue(TaskInformationJob::class,$v); } @@ -37,7 +44,9 @@ class CronController extends BaseApiController // $time=strtotime(date('Y-m-d',strtotime('-1 day'))); $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)->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) { $all = TaskTemplate::where('status', 1)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray();