修改增收补贴金额的错误

This commit is contained in:
luofei 2024-03-05 16:36:02 +08:00
parent 6999d00e07
commit bdf7890cdc

View File

@ -111,14 +111,14 @@ class Store extends BaseController
foreach ($consumption['config'] as $k => $item) {
if (empty($userConsumption) && in_array($merchant['type_id'], $item['type_id'])) {
$saleTarget = $item['amount'];
$subsidyAmount = $saleTarget;
$subsidyAmount = $item['subsidy'];
$purchaseTarget = bcmul($saleTarget, 0.5, 2);
break;
}
if (!empty($userConsumption) && in_array($merchant['type_id'], $item['type_id'])) {
$nextItem = $consumption['config'][$k + 1] ?? $item;
$saleTarget = $nextItem['amount'];
$subsidyAmount = $saleTarget;
$subsidyAmount = $item['subsidy'];
$purchaseTarget = bcmul($saleTarget, 0.5, 2);
break;
}