Explorar el Código

修复:获取可用的优惠券未处理有效期条件

萤火科技 hace 5 años
padre
commit
62634fed91
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      app/api/model/UserCoupon.php

+ 2 - 0
app/api/model/UserCoupon.php

@@ -59,6 +59,8 @@ class UserCoupon extends UserCouponModel
         if ($params['dataType'] === 'isUsable') {
             $filter[] = ['is_use', '=', 0];
             $filter[] = ['is_expire', '=', 0];
+            $filter[] = ['start_time', '<=', time()];
+            $filter[] = ['end_time', '>', time()];
         }
         // 已过期的优惠券
         if ($params['dataType'] === 'isExpire') {