|
@@ -508,13 +508,13 @@ class OrderService
|
|
|
continue;
|
|
|
}
|
|
|
if (in_array($couponDetail->coupon_classify, ['立减券', '满减券'])) {
|
|
|
- if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+// if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
if ($couponDetail->coupon_category == 'PIECE' || ($couponDetail->coupon_category == 'NORMAL' && $countAndAmount['amount'] >= $couponDetail->coupon_minimum_limit)) {
|
|
|
if (!Redis::sIsMember($cacheKey, $couponId)) {
|
|
|
Redis::sAdd($cacheKey, $couponId);
|
|
|
- Redis::sAdd($cacheKey, $goodsId);
|
|
|
+// Redis::sAdd($cacheKey, $goodsId);
|
|
|
$cutBalance = $couponDetail->coupon_value;
|
|
|
}
|
|
|
if ($cutBalance - $money >= 0) {
|
|
@@ -558,9 +558,9 @@ class OrderService
|
|
|
CouponDetail::where('coupon_detail_id', $couponDetail->coupon_detail_id)->update(['coupon_detail_status' => 'USED']);
|
|
|
}
|
|
|
} elseif (in_array($couponDetail->coupon_classify, ['抵用券', '赠品券'])) {
|
|
|
- if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+// if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
if ($couponDetail->coupon_category == 'PIECE' || ($couponDetail->coupon_category == 'NORMAL' && $countAndAmount['amount'] >= $couponDetail->coupon_minimum_limit)) {
|
|
|
$diyongCouponDetailIds = CouponDetail::leftJoin('coupon_goods', 'coupon_goods.join_goods_coupon_id', '=', 'coupon_detail.join_detail_coupon_id')
|
|
|
->where('join_detail_coupon_id', $couponId)
|
|
@@ -592,7 +592,7 @@ class OrderService
|
|
|
if (!Redis::sIsMember($cacheKey, $detailId)) {
|
|
|
$useDetailIds[] = $detailId;
|
|
|
Redis::sAdd($cacheKey, $detailId);
|
|
|
- Redis::sAdd($cacheKey, $goodsId);
|
|
|
+// Redis::sAdd($cacheKey, $goodsId);
|
|
|
CouponDetail::where('coupon_detail_id', $detailId)->update(['coupon_detail_status' => 'USED']);
|
|
|
if ($good['nbr'] > 1) {
|
|
|
$payAmount = $payAmount - $good['goods_sales_price'];
|
|
@@ -615,11 +615,11 @@ class OrderService
|
|
|
Redis::set($cacheDiscountKey, json_encode($discountData,JSON_UNESCAPED_UNICODE));
|
|
|
}
|
|
|
} elseif ($couponDetail->coupon_classify == '福利券') {
|
|
|
- if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+// if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
if (!Redis::sIsMember($cacheKey, $couponId)) {
|
|
|
- Redis::sAdd($cacheKey, $goodsId);
|
|
|
+// Redis::sAdd($cacheKey, $goodsId);
|
|
|
Redis::sAdd($cacheKey, $couponId);
|
|
|
CouponDetail::where('coupon_detail_id', $couponDetail->coupon_detail_id)->update(['coupon_detail_status' => 'USED']);
|
|
|
$welfareBalance = $couponDetail->coupon_value;
|
|
@@ -728,13 +728,13 @@ class OrderService
|
|
|
continue;
|
|
|
}
|
|
|
if (in_array($couponDetail->coupon_classify, ['立减券', '满减券'])) {
|
|
|
- if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+// if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
if ($couponDetail->coupon_category == 'PIECE' || ($couponDetail->coupon_category == 'NORMAL' && $countAndAmount['amount'] >= $couponDetail->coupon_minimum_limit)) {
|
|
|
if (!Redis::sIsMember($cacheKey, $couponId)) {
|
|
|
Redis::sAdd($cacheKey, $couponId);
|
|
|
- Redis::sAdd($cacheKey, $goodsId);
|
|
|
+// Redis::sAdd($cacheKey, $goodsId);
|
|
|
$cutBalance = $couponDetail->coupon_value;
|
|
|
}
|
|
|
if ($cutBalance - $money >= 0) {
|
|
@@ -754,9 +754,9 @@ class OrderService
|
|
|
$payAmount = $payAmount - ($money * (100 - $couponDetail->coupon_value) / 100);
|
|
|
}
|
|
|
} elseif (in_array($couponDetail->coupon_classify, ['抵用券', '赠品券'])) {
|
|
|
- if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+// if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
if ($couponDetail->coupon_category == 'PIECE' || ($couponDetail->coupon_category == 'NORMAL' && $countAndAmount['amount'] >= $couponDetail->coupon_minimum_limit)) {
|
|
|
$diyongCouponDetailIds = CouponDetail::leftJoin('coupon_goods', 'coupon_goods.join_goods_coupon_id', '=', 'coupon_detail.join_detail_coupon_id')
|
|
|
->where('join_detail_coupon_id', $couponId)
|
|
@@ -779,7 +779,7 @@ class OrderService
|
|
|
// 是否计算过了
|
|
|
if (!Redis::sIsMember($cacheKey, $detailId)) {
|
|
|
Redis::sAdd($cacheKey, $detailId);
|
|
|
- Redis::sAdd($cacheKey, $goodsId);
|
|
|
+// Redis::sAdd($cacheKey, $goodsId);
|
|
|
if ($good['nbr'] > 1) {
|
|
|
$payAmount = $payAmount - $good['goods_sales_price'];
|
|
|
$good['nbr'] = $good['nbr'] - 1;
|
|
@@ -791,12 +791,12 @@ class OrderService
|
|
|
}
|
|
|
}
|
|
|
} elseif ($couponDetail->coupon_classify == '福利券') {
|
|
|
- if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+// if (Redis::sIsMember($cacheKey, $goodsId)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
if (!Redis::sIsMember($cacheKey, $couponId)) {
|
|
|
Redis::sAdd($cacheKey, $couponId);
|
|
|
- Redis::sAdd($cacheKey, $goodsId);
|
|
|
+// Redis::sAdd($cacheKey, $goodsId);
|
|
|
$welfareBalance = $couponDetail->coupon_value;
|
|
|
}
|
|
|
if ($welfareBalance >= $money) {
|