修改增收补贴发放的错误

This commit is contained in:
luofei 2024-03-22 15:38:39 +08:00
parent 50fe835c74
commit 4c279f2153
2 changed files with 4 additions and 4 deletions

View File

@ -59,8 +59,8 @@ class OrderDeliveryListen implements ListenerInterface
$userCouponRepo->sendStatus = StoreCouponDetail::SEND_REPEAL;
$userCouponRepo->extra = [
'sale_target' => $couponTotal,
'purchase_target' => $couponTotal * 0.4,
'official_purchase_target' => $couponTotal * 0.6,
'purchase_target' => bcmul($couponTotal, 0.4, 2),
'official_purchase_target' => bcmul($couponTotal, 0.6, 2),
];
$userCouponRepo->send();
}

View File

@ -25,8 +25,8 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface
$count = 0;
if ($coupon) {
foreach ($coupon['config'] as $item) {
$purchaseAmount = $item['amount'] * 0.2; //普通店铺采购金额
$officialPurchaseAmount = $item['amount'] * 0.3; //官方店铺采购金额
$purchaseAmount = bcmul($item['amount'], 0.2, 2); //普通店铺采购金额
$officialPurchaseAmount = bcmul($item['amount'], 0.3, 2); //官方店铺采购金额
$merchants = Merchant::whereIn('type_id', $item['type_id'])
->where('sale_amount', '>=', $item['amount'])
->where('purchase_amount', '>=', $purchaseAmount)