From 161478fdcafe5bccac93701609c0aafb4e1cb2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Fri, 25 Mar 2022 15:20:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E8=B4=A7=E4=B8=9A=E7=BB=A9=E6=AF=8F?= =?UTF-8?q?=E6=9C=8820=E5=8F=B7=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dealer/PurchaseSubsidySettleCommand.php | 14 +++++--------- app/Console/Kernel.php | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/Dealer/PurchaseSubsidySettleCommand.php b/app/Console/Commands/Dealer/PurchaseSubsidySettleCommand.php index d9270b2a..3c83ae0d 100644 --- a/app/Console/Commands/Dealer/PurchaseSubsidySettleCommand.php +++ b/app/Console/Commands/Dealer/PurchaseSubsidySettleCommand.php @@ -56,17 +56,13 @@ class PurchaseSubsidySettleCommand extends Command $tz = now(); if ($tz->day >= 20) { - // 结算当月5号-19号的管理津贴 - $startAt = $tz->copy()->setDay(5)->startOfDay(); + // 上月20号-当月19号的进货业绩 + $startAt = $tz->copy()->subMonthNoOverflow()->setDay(20)->startOfDay(); $endAt = $tz->copy()->setDay(19)->endOfDay(); - } elseif ($tz->day >= 5) { - // 结算上月20号-到当月4号的管理津贴 - $startAt = $tz->copy()->subMonthNoOverflow()->set('day', 20)->startOfDay(); - $endAt = $tz->copy()->set('day', 4)->endOfDay(); } else { - // 结算上月5号-到19号的管理津贴 - $startAt = $tz->copy()->subMonthNoOverflow()->setDay(5)->startOfDay(); - $endAt = $startAt->copy()->setDay(19)->endOfDay(); + // 上上月20号-上月19号的进货业绩 + $startAt = $tz->copy()->subMonthsNoOverflow(2)->setDay(20)->startOfDay(); + $endAt = $tz->copy()->subMonthNoOverflow()->setDay(19)->endOfDay(); } $head = '【'.$startAt->format('Y/m/d').'-'.$endAt->format('Y/m/d').'】'; diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index eaac9232..bd8371a0 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -29,7 +29,7 @@ class Kernel extends ConsoleKernel ->runInBackground(); $schedule->command('dealer:purchase-subsidy-settle') - ->twiceMonthly(5, 20, '3:00') + ->twiceMonthly(20, '3:00') ->runInBackground(); $schedule->command('dealer:manager-subsidy-settle')