cqp 4 days ago
parent
commit
02138e1746
1 changed files with 6 additions and 1 deletions
  1. 6 1
      app/Service/DispatchService.php

+ 6 - 1
app/Service/DispatchService.php

@@ -14,6 +14,8 @@ use App\Model\OrdersProductProcess;
 use App\Model\Process;
 use App\Model\Team;
 use App\Model\Technology;
+use App\Model\Zj;
+use App\Model\ZjPlan;
 use Illuminate\Support\Facades\DB;
 
 class DispatchService extends Service
@@ -599,7 +601,7 @@ class DispatchService extends Service
 
     public function dispatchOrderList($data){
         $model = DispatchSub::where('del_time',0)
-            ->select('id','order_no','table_header_mark','product_no','product_title','product_size','product_unit','dispatch_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','production_quantity','dispatch_no','crt_id','process_id','dispatch_time_start','dispatch_time_end','crt_time','finished_num','waste_num','customer_name','order_product_id','out_order_no','team_id','device_id','wg_status','status','type')
+            ->select('id','order_no','table_header_mark','product_no','product_title','product_size','product_unit','dispatch_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','production_quantity','dispatch_no','crt_id','process_id','dispatch_time_start','dispatch_time_end','crt_time','finished_num','waste_num','customer_name','order_product_id','out_order_no','team_id','device_id','wg_status','status','type','zj_plan_id')
             ->orderBy('id','desc');
 
         if(isset($data['type'])) $model->where('type', $data['type']);
@@ -666,7 +668,10 @@ class DispatchService extends Service
         $orders = OrdersProduct::whereIn('id', array_column($data['data'],'order_product_id'))
             ->pluck('production_no','id')
             ->toArray();
+
+        $map = ZjPlan::where('del_time',0)->pluck('title','id')->toArray();
         foreach ($data['data'] as $key => $value){
+            $data['data'][$key]['zj_plan_title'] = $map[$value['zj_plan_id']] ?? "";
             $data['data'][$key]['wg_status_title'] = DispatchSub::$status_name[$value['wg_status']] ?? "";
             $data['data'][$key]['status_title'] = DispatchSub::$status_name[$value['status']] ?? "";
             $data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d',$value['crt_time']) : '';