|
@@ -590,11 +590,11 @@ class OrderService
|
|
->leftJoin('coupon', 'coupon.coupon_id', '=', 'coupon_detail.join_detail_coupon_id')
|
|
->leftJoin('coupon', 'coupon.coupon_id', '=', 'coupon_detail.join_detail_coupon_id')
|
|
->select('coupon_detail.coupon_detail_id', 'coupon_goods.coupon_goods_id', 'coupon_id', 'coupon_classify', 'coupon_value', 'coupon_minimum_limit', 'coupon_category')
|
|
->select('coupon_detail.coupon_detail_id', 'coupon_goods.coupon_goods_id', 'coupon_id', 'coupon_classify', 'coupon_value', 'coupon_minimum_limit', 'coupon_category')
|
|
->where('coupon_goods.join_coupon_goods_id', $goodsId)
|
|
->where('coupon_goods.join_coupon_goods_id', $goodsId)
|
|
- ->where('coupon_goods.join_coupon_goods_sku_id', $good['sku_id'])
|
|
|
|
|
|
+// ->where('coupon_goods.join_coupon_goods_sku_id', $good['sku_id'])
|
|
->where('join_goods_coupon_id', $couponId)
|
|
->where('join_goods_coupon_id', $couponId)
|
|
->where('coupon_detail.join_coupon_detail_member_id', $memberId)
|
|
->where('coupon_detail.join_coupon_detail_member_id', $memberId)
|
|
- ->where('coupon_detail.coupon_detail_gain_datetime','<',date('Y-m-d H:i:s'))
|
|
|
|
- ->where('coupon_detail.coupon_detail_deadline_datetime','>',date('Y-m-d H:i:s'));;
|
|
|
|
|
|
+ ->where('coupon_detail.coupon_detail_gain_datetime', '<', date('Y-m-d H:i:s'))
|
|
|
|
+ ->where('coupon_detail.coupon_detail_deadline_datetime', '>', date('Y-m-d H:i:s'));
|
|
if ($settlementNow == 'Y' && $type == 'pay') {
|
|
if ($settlementNow == 'Y' && $type == 'pay') {
|
|
$couponDetail = $couponDetail->whereIn('coupon_detail.coupon_detail_status', ['ACTIVED']);
|
|
$couponDetail = $couponDetail->whereIn('coupon_detail.coupon_detail_status', ['ACTIVED']);
|
|
} else {
|
|
} else {
|
|
@@ -775,9 +775,11 @@ class OrderService
|
|
->leftJoin('coupon', 'coupon.coupon_id', '=', 'coupon_detail.join_detail_coupon_id')
|
|
->leftJoin('coupon', 'coupon.coupon_id', '=', 'coupon_detail.join_detail_coupon_id')
|
|
->select('coupon_detail.coupon_detail_id', 'coupon_goods.coupon_goods_id', 'coupon_id', 'coupon_classify', 'coupon_value', 'coupon_minimum_limit', 'coupon_category')
|
|
->select('coupon_detail.coupon_detail_id', 'coupon_goods.coupon_goods_id', 'coupon_id', 'coupon_classify', 'coupon_value', 'coupon_minimum_limit', 'coupon_category')
|
|
->where('coupon_goods.join_coupon_goods_id', $goodsId)
|
|
->where('coupon_goods.join_coupon_goods_id', $goodsId)
|
|
- ->where('coupon_goods.join_coupon_goods_sku_id', $good['sku_id'])
|
|
|
|
|
|
+// ->where('coupon_goods.join_coupon_goods_sku_id', $good['sku_id'])
|
|
->where('join_goods_coupon_id', $couponId)
|
|
->where('join_goods_coupon_id', $couponId)
|
|
- ->where('coupon_detail.join_coupon_detail_member_id', $memberId);
|
|
|
|
|
|
+ ->where('coupon_detail.join_coupon_detail_member_id', $memberId)
|
|
|
|
+ ->where('coupon_detail.coupon_detail_gain_datetime', '<', date('Y-m-d H:i:s'))
|
|
|
|
+ ->where('coupon_detail.coupon_detail_deadline_datetime', '>', date('Y-m-d H:i:s'));
|
|
if ($settlementNow == 'Y') {
|
|
if ($settlementNow == 'Y') {
|
|
$couponDetail = $couponDetail->whereIn('coupon_detail.coupon_detail_status', ['ACTIVED']);
|
|
$couponDetail = $couponDetail->whereIn('coupon_detail.coupon_detail_status', ['ACTIVED']);
|
|
} else {
|
|
} else {
|
|
@@ -875,14 +877,15 @@ class OrderService
|
|
$goodsIds = array_column($goods, 'goods_id');
|
|
$goodsIds = array_column($goods, 'goods_id');
|
|
$couponGoods = CouponGoods::whereIn('join_coupon_goods_id', $goodsIds)
|
|
$couponGoods = CouponGoods::whereIn('join_coupon_goods_id', $goodsIds)
|
|
->where('join_goods_coupon_id', $couponId)
|
|
->where('join_goods_coupon_id', $couponId)
|
|
- ->select('join_coupon_goods_id', 'join_coupon_goods_sku_id')
|
|
|
|
|
|
+// ->select('join_coupon_goods_id', 'join_coupon_goods_sku_id')
|
|
->get()
|
|
->get()
|
|
->toArray();
|
|
->toArray();
|
|
$count = 0;
|
|
$count = 0;
|
|
$amount = 0;
|
|
$amount = 0;
|
|
foreach ($couponGoods as $couponGood) {
|
|
foreach ($couponGoods as $couponGood) {
|
|
foreach ($goods as $good) {
|
|
foreach ($goods as $good) {
|
|
- if ($good['goods_id'] == $couponGood['join_coupon_goods_id'] && $good['sku_id'] == $couponGood['join_coupon_goods_sku_id']) {
|
|
|
|
|
|
+// if ($good['goods_id'] == $couponGood['join_coupon_goods_id'] && $good['sku_id'] == $couponGood['join_coupon_goods_sku_id']) {
|
|
|
|
+ if ($good['goods_id'] == $couponGood['join_coupon_goods_id']) {
|
|
$count += $good['nbr'];
|
|
$count += $good['nbr'];
|
|
$amount += $good['goods_sales_price'] * $good['nbr'];
|
|
$amount += $good['goods_sales_price'] * $good['nbr'];
|
|
}
|
|
}
|