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