Bladeren bron

[智价云] 导入时间限制更新

tangyuanwang 13 uur geleden
bovenliggende
commit
9282041afb

+ 3 - 0
app/Http/Controllers/Manager/Process/LowPriceGoods.php

@@ -1215,6 +1215,9 @@ class LowPriceGoods extends Controller
             if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$item[21])){
                 return ['code' => 'error', 'msg' => "第{$key}行检索采集日期格式不正确", 'data' => $item];
             }
+            if (strtotime($item[21]. ' 23:59:59') > time()){
+                return ['code' => 'error', 'msg' => "第{$key}行检索采集日期不能大于当前日期", 'data' => $item];
+            }
         }
 
     }

+ 3 - 0
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -1012,6 +1012,9 @@ class ViolationProduct extends Controller
             if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$item[19])){
                 return ['code' => 'error', 'msg' => "第{$key}行检索采集日期格式不正确", 'data' => $item];
             }
+            if (strtotime($item[19]. ' 23:59:59') > time()){
+                return ['code' => 'error', 'msg' => "第{$key}行检索采集日期不能大于当前日期", 'data' => $item];
+            }
         }
     }
 }