wesmiler hai 1 día
pai
achega
7ed4a61b30
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      app/Services/Api/GoodsService.php

+ 3 - 4
app/Services/Api/GoodsService.php

@@ -267,12 +267,11 @@ class GoodsService extends BaseService
 
         }
 
-        $couponGoodsIds = [];
+        // 优惠券信息
         $couponInfo = [];
         if($couponId){
             $couponInfo = MemberCouponModel::where(['coupon_id'=>$couponId,'user_id'=>$userId,'mark'=>1])->first();
             $couponType = isset($couponInfo['coupon_type'])?$couponInfo['coupon_type'] : 0;
-            $couponGoodsIds = isset($couponInfo['goods_ids'])&& $couponInfo['goods_ids']?explode(',', $couponInfo['goods_ids']) : [];
             if(empty($couponInfo) || $couponType<=0){
                 $this->error = '优惠券无效';
                 return false;
@@ -352,9 +351,9 @@ class GoodsService extends BaseService
                     if($payTotal){
                         $total = $payTotal;
                         $item['coupon_id'] = $couponId;
-                        $item['coupon_total'] = $couponTotal;
+                        $item['coupon_total'] = floatval($couponTotal);
                         $result['coupon_id'] = $couponId;
-                        $result['coupon_total'] = $couponTotal;
+                        $result['coupon_total'] = floatval($couponTotal);
                         $isGoodsCoupon = true;
                     }