From b880ddc322bf6b47b78d8542126b2ef6fa95f81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Fri, 1 Apr 2022 09:49:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=BD=93=E6=9C=9F=E8=BF=9B?= =?UTF-8?q?=E8=B4=A7=E4=B8=9A=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dealer/CalculatePurchaseAmountOfCurrentPeriod.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Actions/Dealer/CalculatePurchaseAmountOfCurrentPeriod.php b/app/Actions/Dealer/CalculatePurchaseAmountOfCurrentPeriod.php index 03c32b68..0396f595 100644 --- a/app/Actions/Dealer/CalculatePurchaseAmountOfCurrentPeriod.php +++ b/app/Actions/Dealer/CalculatePurchaseAmountOfCurrentPeriod.php @@ -22,11 +22,11 @@ class CalculatePurchaseAmountOfCurrentPeriod $tz = now(); if ($tz->day >= 20) { - $startAt = $tz->copy()->setDay(20)->startOfDay(); - } elseif ($tz->day >= 5) { - $startAt = $tz->copy()->setDay(5)->startOfDay(); - } else { + // 上月20号-当月19号的进货业绩 $startAt = $tz->copy()->subMonthNoOverflow()->setDay(20)->startOfDay(); + } else { + // 上上月20号-上月19号的进货业绩 + $startAt = $tz->copy()->subMonthsNoOverflow(2)->setDay(20)->startOfDay(); } return bcmul($this->calculatePurchaseAmount->handle($dealer, $startAt), '1', 2);