q преди 1 година
родител
ревизия
4656bbe026
променени са 2 файла, в които са добавени 27 реда и са изтрити 0 реда
  1. 26 0
      Modules/OpcData/Http/Controllers/Api/CarDownCurrInfoController.php
  2. 1 0
      Modules/OpcData/Routes/api.php

+ 26 - 0
Modules/OpcData/Http/Controllers/Api/CarDownCurrInfoController.php

@@ -40,6 +40,32 @@ class CarDownCurrInfoController extends BaseController
         return json_encode($data);
     }
 
+    public function taskList(Request  $request) {
+        $sqlStr = /** @lang text */
+            "SELECT apply_time, task_state, task_info, dest, t1.car_model, t2.per_name, t2.dep
+               FROM down_task_info t
+               left join down_car_base_info t1 on t.car_num = t1.car_num
+               left join down_personnel_info t2 on t.driver_num = t2.per_num
+              where DATE_FORMAT(apply_time,'%Y-%m-%d') = (select max(DATE_FORMAT(apply_time,'%Y-%m-%d')) FROM down_task_info)
+              ORDER BY task_state desc, apply_time";
+        $list = $this->executeSql($sqlStr);
+
+        $sqlStr = /** @lang text */
+            "select task_state, count(1) con from down_task_info
+              where DATE_FORMAT(apply_time,'%Y-%m-%d') =
+                    (select max(DATE_FORMAT(apply_time,'%Y-%m-%d'))
+                       FROM down_task_info)
+              GROUP BY task_state";
+        $groupCon = $this->executeSql($sqlStr);
+
+        $data = [
+            'charts'=>$groupCon,
+            'list'=>$list
+        ];
+
+        return json_encode($data);
+    }
+
     public function getCarCon($mineCode='zaoquan') {
         $sqlStr = /** @lang text */
             "SELECT count(1) con FROM down_car_site_status where out_time is null or out_time < in_time";

+ 1 - 0
Modules/OpcData/Routes/api.php

@@ -23,6 +23,7 @@ Route::namespace('Api')->group(function () {
     Route::any('apidata/getCarDownIllegalAllList', 'CarIllegalDownController@getList');
     Route::any('apidata/getCarCurrInfoList', 'CarDownCurrInfoController@getList');
     Route::any('apidata/getDriverInfoList', 'CarDownCurrInfoController@driverList');
+    Route::any('apidata/getCarTaskInfoList', 'CarDownCurrInfoController@driverList');
     Route::any('apidata/getLightCurrInfoList', 'CarDownCurrLightInfoController@getList');
     Route::any('apidata/getSiteCurrInfoList', 'CarDownCurrSiteInfoController@getList');