From 4349a46a6df8893d2d7babd6a0f3e8ad64dc07b0 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Fri, 24 Mar 2023 12:01:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E4=B8=8D=E6=89=BE=E6=8B=86=E5=88=86=E7=9A=84=E4=B8=BB=E8=AE=A2?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/order/StoreCartServices.php | 5 +++-- crmeb/app/services/order/StoreOrderRefundServices.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crmeb/app/services/order/StoreCartServices.php b/crmeb/app/services/order/StoreCartServices.php index d4efe3568..9367bd849 100644 --- a/crmeb/app/services/order/StoreCartServices.php +++ b/crmeb/app/services/order/StoreCartServices.php @@ -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]); diff --git a/crmeb/app/services/order/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index 3fd06be86..97dc9f9ed 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/crmeb/app/services/order/StoreOrderRefundServices.php @@ -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',