From a1c8cb2e2a5abceac791ed6f4b76b30061285006 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 21 Sep 2023 09:34:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E4=B9=8B=E5=89=8D=E7=9A=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=BB=93=E7=AE=97=E9=99=90=E5=88=B6=E5=88=B0=E5=8F=AA?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=B0=8F=E7=BB=84=E6=9C=8D=E5=8A=A1=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/task/TaskSettlementCron.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/task/TaskSettlementCron.php b/app/task/TaskSettlementCron.php index c28a2a343..efff52cb8 100644 --- a/app/task/TaskSettlementCron.php +++ b/app/task/TaskSettlementCron.php @@ -21,9 +21,20 @@ class TaskSettlementCron extends Task{ protected function execute() { //yesterday - $all=TaskSchedulingPlan::whereDay('end_time','yesterday')->where('is_pay',0)->with(['template_info','scheduling'=>function($query){ - $query->where('company_type', 18); - }])->select()->toArray(); +// $all=TaskSchedulingPlan::whereDay('end_time','yesterday') +// ->where('is_pay',0) +// ->with(['template_info','scheduling'=>function($query){ +// $query->where('company_type', 18); +// }]) +// ->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); }