Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/fyy' into fyy

root 2 gadi atpakaļ
vecāks
revīzija
e26f2ca93d
1 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. 7 7
      app/Http/Controllers/Api/ScreenController.php

+ 7 - 7
app/Http/Controllers/Api/ScreenController.php

@@ -404,14 +404,14 @@ class ScreenController extends BaseController
      * @return array
      */
     public function nu_work_order(Request $request){
-        $date = date('Ymd',time());
+        // 获取当前时间戳
+        $currentTimestamp = time();
+        $startOfDay = strtotime(date('Y-m-d 00:00:00', $currentTimestamp));
 
-        //工序-----------------------------
-        $model = new OrdersProductProcess(['channel' => $date]);//当前季度的数据
-        $result = $model->where('del_time',0)
-            ->where('status',0)
-            ->select('production_no as order_no','product_title','process_id',DB::raw('count(id) as product_num'))
-            ->groupBy('order_product_id')
+        $result = DispatchSub::where('del_time',0)
+            ->where('dispatch_time_start',">=", $startOfDay)
+            ->where('finished_num',0)
+            ->select('dispatch_no as order_no','product_title','dispatch_quantity as product_num','process_id')
             ->get()->toArray();
 
         if(! empty($result)){