Explorar o código

班组切换开工时间优化

qiuenguang hai 1 ano
pai
achega
139eb44b83
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      application/api/controller/Facility.php

+ 5 - 2
application/api/controller/Facility.php

@@ -412,9 +412,9 @@ class Facility extends Api
                     unset($orderList[$key]);
                 }
             }
-
+            $data = array_values($orderList);
         }
-        $this->success('成功',$orderList);
+        $this->success('成功',$data);
     }
 
 
@@ -1656,6 +1656,7 @@ class Facility extends Api
         $end_time1 = strtotime(date('Y-m-d') . ' 20:30:00');
         $end_time2 = strtotime(date('Y-m-d') . ' 24:00:00');
         $start_time3 = strtotime(date('Y-m-d', strtotime('+1 day')) . ' 08:30:00');
+        $start_time4 = strtotime(date('Y-m-d', strtotime('+1 day')) . ' 00:00:00');
         // 判断当前时间属于哪个时间范围
         if ($current_time >= $start_time1 && $current_time <= $end_time1) {
             $data['开工时间'] = date('Y-m-d') . ' 08:30:00';
@@ -1664,6 +1665,8 @@ class Facility extends Api
 
         } elseif ($current_time > $end_time1 && $current_time <= $start_time3) {
             $data['开工时间'] = date('Y-m-d', strtotime('+1 day')) . ' 08:30:00';
+        }elseif ($current_time > $start_time4 && $current_time <= $start_time3){
+            $data['开工时间'] = date('Y-m-d') . ' 20:30:00';
         }
         if (!empty($params['order']) && !empty($params['yjno'])){
             $option['Gy0_gdbh'] = $params['order'];