|
@@ -275,24 +275,27 @@ class GoodsService extends BaseService
|
|
|
$couponStatus = isset($couponInfo['status'])?$couponInfo['status'] : 0;
|
|
$couponStatus = isset($couponInfo['status'])?$couponInfo['status'] : 0;
|
|
|
$startTime = isset($couponInfo['start_time'])?$couponInfo['start_time'] : 0;
|
|
$startTime = isset($couponInfo['start_time'])?$couponInfo['start_time'] : 0;
|
|
|
$endTime = isset($couponInfo['end_time'])?$couponInfo['end_time'] : 0;
|
|
$endTime = isset($couponInfo['end_time'])?$couponInfo['end_time'] : 0;
|
|
|
- if(empty($couponInfo) || $couponType<=0){
|
|
|
|
|
- $this->error = '优惠券无效';
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 下单需验证
|
|
|
|
|
+ if($orderNo){
|
|
|
|
|
+ if(empty($couponInfo) || $couponType<=0){
|
|
|
|
|
+ $this->error = '优惠券无效';
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if($couponStatus != 1){
|
|
|
|
|
- $this->error = '该优惠券已使用,请刷新后重试~';
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if($couponStatus != 1){
|
|
|
|
|
+ $this->error = '该优惠券已使用,请刷新后重试~';
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if($startTime > time()){
|
|
|
|
|
- $this->error = '该优惠券使用时间未到~';
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if($startTime > time()){
|
|
|
|
|
+ $this->error = '该优惠券使用时间未到~';
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if($endTime && $endTime < time()){
|
|
|
|
|
- $this->error = '该优惠券已过期~';
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ if($endTime && $endTime < time()){
|
|
|
|
|
+ $this->error = '该优惠券已过期~';
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|