|
@@ -126,11 +126,11 @@ class CouponDetailController extends Curd
|
|
$item['gettype'] = $couponDetailExtendJson['gettype'];
|
|
$item['gettype'] = $couponDetailExtendJson['gettype'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (!empty($item['coupon_detail_deadline_datetime'])){
|
|
|
|
- $item['coupon_detail_deadline_datetime'] = date('Y/m/d H:i:s',strtotime($item['coupon_detail_deadline_datetime']));
|
|
|
|
|
|
+ if (!empty($item['coupon_detail_deadline_datetime'])) {
|
|
|
|
+ $item['coupon_detail_deadline_datetime'] = date('Y/m/d H:i:s', strtotime($item['coupon_detail_deadline_datetime']));
|
|
}
|
|
}
|
|
- if (!empty($item['coupon_detail_gain_datetime'])){
|
|
|
|
- $item['coupon_detail_gain_datetime'] = date('Y/m/d H:i:s',strtotime($item['coupon_detail_gain_datetime']));
|
|
|
|
|
|
+ if (!empty($item['coupon_detail_gain_datetime'])) {
|
|
|
|
+ $item['coupon_detail_gain_datetime'] = date('Y/m/d H:i:s', strtotime($item['coupon_detail_gain_datetime']));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -221,13 +221,16 @@ class CouponDetailController extends Curd
|
|
$query->select('coupon_id', 'coupon_name', 'coupon_classify', 'coupon_value', 'coupon_category', 'coupon_minimum_limit');
|
|
$query->select('coupon_id', 'coupon_name', 'coupon_classify', 'coupon_value', 'coupon_category', 'coupon_minimum_limit');
|
|
}
|
|
}
|
|
])->whereIn('join_detail_coupon_id', $couponIds)
|
|
])->whereIn('join_detail_coupon_id', $couponIds)
|
|
- ->where('join_coupon_detail_member_id', $memberId);
|
|
|
|
- if ($settlementNow == 'Y') {
|
|
|
|
- $details = $details->whereIn('coupon_detail.coupon_detail_status', ['ACTIVED', 'WAITING']);
|
|
|
|
- } else {
|
|
|
|
- $details = $details->where('coupon_detail.coupon_detail_status', 'ACTIVED');
|
|
|
|
- }
|
|
|
|
- $details = $details->selectRaw('join_detail_coupon_id,join_coupon_detail_member_id,COUNT(*) as count')
|
|
|
|
|
|
+ ->where('join_coupon_detail_member_id', $memberId)
|
|
|
|
+ ->where('coupon_detail_gain_datetime','<',date('Y-m-d H:i:s'))
|
|
|
|
+ ->where('coupon_detail_deadline_datetime','>',date('Y-m-d H:i:s'));
|
|
|
|
+
|
|
|
|
+ if ($settlementNow == 'Y') {
|
|
|
|
+ $details = $details->whereIn('coupon_detail.coupon_detail_status', ['ACTIVED', 'WAITING']);
|
|
|
|
+ } else {
|
|
|
|
+ $details = $details->where('coupon_detail.coupon_detail_status', 'ACTIVED');
|
|
|
|
+ }
|
|
|
|
+ $details = $details->selectRaw('join_detail_coupon_id,join_coupon_detail_member_id,COUNT(*) as count')
|
|
->groupBy('join_detail_coupon_id', 'join_coupon_detail_member_id')
|
|
->groupBy('join_detail_coupon_id', 'join_coupon_detail_member_id')
|
|
->get()
|
|
->get()
|
|
->toArray();
|
|
->toArray();
|