6
0
Fork 0

计算当期进货业绩

release
李静 2022-04-01 09:49:40 +08:00
parent 78af7fd2cf
commit b880ddc322
1 changed files with 4 additions and 4 deletions

View File

@ -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);