|
@@ -23,13 +23,7 @@ class UserCoupon extends BaseModel
|
|
exit_out(null, 10003, '该优惠券已过期');
|
|
exit_out(null, 10003, '该优惠券已过期');
|
|
}
|
|
}
|
|
if ($userCoupon['status'] == 1) {
|
|
if ($userCoupon['status'] == 1) {
|
|
- if ($userCoupon['expire_type'] == 1) {
|
|
|
|
- $expire_time = strtotime($userCoupon['created_at']) + $userCoupon['effective_days']*24*3600;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- $expire_time = $userCoupon['end_time'];
|
|
|
|
- }
|
|
|
|
- if ($expire_time < time()) {
|
|
|
|
|
|
+ if ($userCoupon['expire_time'] < time()) {
|
|
self::where('id', $id)->update(['status' => 3]);
|
|
self::where('id', $id)->update(['status' => 3]);
|
|
exit_out(null, 10004, '该优惠券已过期');
|
|
exit_out(null, 10004, '该优惠券已过期');
|
|
}
|
|
}
|