Bladeren bron

[智价云] 采集时间校验更新

tangyuanwang 2 dagen geleden
bovenliggende
commit
2d5dfaa565
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      app/Http/Controllers/Manager/Collect/Product.php

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

@@ -205,7 +205,7 @@ class Product extends Controller
         $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00') : '0';
         $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59') : '0';
         $all_data['minimum_order_quantity'] = $minimum_order_quantity;
-        if ($all_data['sampling_start_time']  && $all_data['sampling_start_time'] < time()) return json_send(['code' => 'error', 'msg' => '采集开始时间必须大于当前时间']);
+        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' => '采集结束时间必须大于当前时间']);
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
@@ -272,7 +272,7 @@ class Product extends Controller
         $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00') : '0';
         $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59') : '0';
         $all_data['minimum_order_quantity'] = $minimum_order_quantity;
-        if ($all_data['sampling_start_time']  && $all_data['sampling_start_time'] < time()) return json_send(['code' => 'error', 'msg' => '采集开始时间必须大于当前时间']);
+        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' => '采集结束时间必须大于当前时间']);
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];