|
|
|
@ -159,11 +159,10 @@ class CouponController extends BaseController |
|
|
|
$expired = []; |
|
|
|
|
|
|
|
$couponIds = $couponIds->toArray(); |
|
|
|
$coupons = Coupon::orderByRaw('FIELD(id, ' . implode(", ", $couponIds) . ')')->get(); |
|
|
|
|
|
|
|
|
|
|
|
$coupons = Coupon::whereIn('id',$couponIds)->get(); |
|
|
|
|
|
|
|
foreach ($coupons as $key => $coupon) { |
|
|
|
if ($coupon->usable_end_time < $nowTime) { |
|
|
|
if ($coupon->usable_end_time < $nowTime || $coupon->status != 1) { |
|
|
|
$expired[] = $coupon; |
|
|
|
} else { |
|
|
|
$not_expired[] = $coupon; |
|
|
|
|