调整优惠券余额扣除
This commit is contained in:
parent
b87c5a9f79
commit
9bf5deef2c
@ -266,4 +266,19 @@ class StoreCouponUserDao extends BaseDao
|
|||||||
return $rate;
|
return $rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量扣除优惠券余额
|
||||||
|
* @param $coupons
|
||||||
|
* @return void
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function reduceAll($coupons)
|
||||||
|
{
|
||||||
|
foreach ($coupons as $coupon) {
|
||||||
|
$this->reduce($coupon['coupon_user_id'], $coupon['coupon_price']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1191,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($useCoupon[$order['mer_id']])) {
|
if (!empty($useCoupon[$order['mer_id']])) {
|
||||||
$storeCouponUserDao->reduceAll($order['cartInfo']['order']['store_coupon']);
|
$storeCouponUserDao->reduceAll($order['cartInfo']['order']['user_used_coupon']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user