mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
加入购物车不找拆分的主订单
This commit is contained in:
parent
14fa981539
commit
4349a46a6d
@ -679,6 +679,7 @@ class StoreCartServices extends BaseServices
|
||||
* @param $num
|
||||
* @param $new
|
||||
* @return bool
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public function checkLimit($uid, $product_id, $num, $new)
|
||||
{
|
||||
@ -701,8 +702,8 @@ class StoreCartServices extends BaseServices
|
||||
}
|
||||
} else if ($limitInfo['limit_type'] == 2) {
|
||||
$cartNum = $this->dao->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
|
||||
$orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
|
||||
$orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id], 'refund_num');
|
||||
$orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'pid' => 0], 'cart_num');
|
||||
$orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'pid' => 0], 'refund_num');
|
||||
$orderNum = $orderPayNum - $orderRefundNum;
|
||||
if (($num + $orderNum + $cartNum) > $limitInfo['limit_num']) {
|
||||
throw new ApiException(410240, ['limit' => $limitInfo['limit_num'], 'pay_num' => $orderNum]);
|
||||
|
||||
@ -435,9 +435,9 @@ class StoreOrderRefundServices extends BaseServices
|
||||
$res = true;
|
||||
//回退优惠卷 拆分子订单不退优惠券
|
||||
if (!$order['pid'] && $order['coupon_id'] && $order['coupon_price']) {
|
||||
/** @var StoreCouponUserServices $coumonUserServices */
|
||||
$coumonUserServices = app()->make(StoreCouponUserServices::class);
|
||||
$res = $res && $coumonUserServices->recoverCoupon((int)$order['coupon_id']);
|
||||
/** @var StoreCouponUserServices $couponUserServices */
|
||||
$couponUserServices = app()->make(StoreCouponUserServices::class);
|
||||
$res = $couponUserServices->recoverCoupon((int)$order['coupon_id']);
|
||||
$statusService->save([
|
||||
'oid' => $order['id'],
|
||||
'change_type' => 'coupon_back',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user