Selaa lähdekoodia

[智价云] 采集日期更新

tangyuanwang 11 tuntia sitten
vanhempi
sitoutus
d68598de0e
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      app/Http/Controllers/Manager/Collect/Product.php

+ 2 - 2
app/Http/Controllers/Manager/Collect/Product.php

@@ -272,7 +272,7 @@ class Product extends Controller
         if (is_numeric($round_number) && $round_number > 3) return json_send(['code' => 'error', 'msg' => '轮次数量不能超过3']);
         if ($all_data['sampling_start_time']  && strtotime(date('Y-m-d', $all_data['sampling_start_time']) . '23:59:59') < time()) return json_send(['code' => 'error', 'msg' => '采集开始时间必须大于当前时间']);
         if ($all_data['sampling_end_time']  && $all_data['sampling_end_time'] < time()) return json_send(['code' => 'error', 'msg' => '采集结束时间必须大于当前时间']);
-        if ($all_data['sampling_start_time'] > $all_data['sampling_end_time']) return json_send(['code' => 'error', 'msg' => '采集结束时间必须大于开始时间']);
+        if ($all_data['sampling_start_time'] !='' && $all_data['sampling_end_time'] !='' && $all_data['sampling_start_time'] > $all_data['sampling_end_time']) return json_send(['code' => 'error', 'msg' => '采集结束时间必须大于开始时间']);
 
         $platform_string = $all_data['platform'];
         if (empty($platform_string)) return json_send(['code' => 'error', 'msg' => '平台不能为空']);
@@ -424,7 +424,7 @@ class Product extends Controller
         if (is_numeric($round_number) && $round_number > 3) return json_send(['code' => 'error', 'msg' => '轮次数量不能超过3']);
         if ($all_data['sampling_start_time']  && strtotime(date('Y-m-d', $all_data['sampling_start_time']) . '23:59:59') < time()) return json_send(['code' => 'error', 'msg' => '采集开始时间必须大于当前时间']);
         if ($all_data['sampling_end_time']  && $all_data['sampling_end_time'] < time()) return json_send(['code' => 'error', 'msg' => '采集结束时间必须大于当前时间']);
-        if ($all_data['sampling_start_time'] > $all_data['sampling_end_time']) return json_send(['code' => 'error', 'msg' => '采集结束时间必须大于开始时间']);
+        if ($all_data['sampling_start_time'] !='' && $all_data['sampling_end_time'] !='' && $all_data['sampling_start_time'] > $all_data['sampling_end_time']) return json_send(['code' => 'error', 'msg' => '采集结束时间必须大于开始时间']);
 
         $platform_string = $all_data['platform'];
         if (empty($platform_string)) return json_send(['code' => 'error', 'msg' => '平台不能为空']);