浏览代码

优惠券使用时间和领取时间判断。

evoxwht 2 年之前
父节点
当前提交
51cf0c9e6a
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      crmeb/app/services/activity/coupon/StoreCouponIssueServices.php

+ 8 - 0
crmeb/app/services/activity/coupon/StoreCouponIssueServices.php

@@ -91,6 +91,14 @@ class StoreCouponIssueServices extends BaseServices
     public function saveCoupon($data)
     public function saveCoupon($data)
     {
     {
         if ($data['start_time'] && $data['start_use_time']) {
         if ($data['start_time'] && $data['start_use_time']) {
+
+            if ($data['start_time'] < date('Y-m-d 00:00:00')) {
+                throw new AdminException('开始领取时间不能小于当前时间');
+            }
+            if ($data['start_use_time'] < date('Y-m-d 00:00:00')) {
+                throw new AdminException('开始使用时间不能小于当前时间');
+            }
+
             if ($data['start_use_time'] < $data['start_time']) {
             if ($data['start_use_time'] < $data['start_time']) {
                 throw new AdminException(400513);
                 throw new AdminException(400513);
             }
             }