cqpCow 1 рік тому
батько
коміт
782a1b6339
2 змінених файлів з 7 додано та 2 видалено
  1. 6 2
      app/Service/ScheduleService.php
  2. 1 0
      routes/wx.php

+ 6 - 2
app/Service/ScheduleService.php

@@ -491,7 +491,7 @@ class ScheduleService extends Service
             ->where('end_time', '<=', $endTimestamp)
             ->select('id')
             ->get()->toArray();
-        if(empty($schedule)) return [true, $return];
+        if(empty($schedule)) return [true, array_values($return)];
 
         $construction = Construction::where('del_time',0)
             ->whereIn('schedule_id',array_column($schedule,'id'))
@@ -515,7 +515,7 @@ class ScheduleService extends Service
 
         $construction = Construction::where('del_time',0)
             ->whereIn('id',$order_id)
-            ->select('id','order_number','crt_id')
+            ->select('id','order_number','crt_id','day_start_stamp','day_end_stamp')
             ->get()->toArray();
         if(empty($construction)) return [true, ""];
         $emp = Employee::whereIn('id',array_unique(array_column($construction,'crt_id')))
@@ -538,10 +538,14 @@ class ScheduleService extends Service
 
         $return = [];
         foreach ($construction as $value){
+            $str = "";
+            if(! empty($value['day_start_stamp']) && ! empty($value['day_end_stamp'])) $str = date('Y-m-d H:i',$value['day_start_stamp']) . '-' . date("H:i",$value['day_end_stamp']);
+
             $tmp = [
                 'order_number' => $value['order_number'],
                 'crt_name' => $emp[$value['crt_id']] ?? "",
                 'product' => $product_title[$value['id']],
+                'crt_time' => $str,
             ];
             $return[] = $tmp;
         }

+ 1 - 0
routes/wx.php

@@ -90,4 +90,5 @@ Route::group(['middleware'=> ['checkWx']],function ($route){
     $route->any('getMySetting', 'Api\ProductInventoryController@getMySetting');
 
     $route->any('getSettingTotal', 'Api\ScheduleController@getSettingTotal');
+    $route->any('getSettingGetDetail', 'Api\ScheduleController@getSettingGetDetail');
 });