|
@@ -211,8 +211,8 @@ class ScrappService extends Service
|
|
|
$sales_number = SaleOrdersProduct::whereIn('id',array_unique(array_column($data['data'],'sale_orders_product_id')))
|
|
|
->pluck('out_order_no','id')
|
|
|
->toArray();
|
|
|
- $dispatch_no = DispatchSub::whereIn('id',array_column($data['data'], 'dispatch_sub_id'))
|
|
|
- ->pluck('dispatch_no','id')
|
|
|
+ $dispatch_no = ReportWorking::whereIn('id',array_column($data['data'], 'report_id'))
|
|
|
+ ->pluck('order_number','id')
|
|
|
->toArray();
|
|
|
$return = [];
|
|
|
if(! empty($erg['material'])){
|
|
@@ -230,7 +230,7 @@ class ScrappService extends Service
|
|
|
$data['data'][$key]['equipment_title'] = $equipment_map[$value['equipment_id']] ?? '';
|
|
|
$data['data'][$key]['process_title'] = $process_map[$value['process_id']] ?? '';
|
|
|
$data['data'][$key]['sale_order_number'] = $sales_number[$value['sale_orders_product_id']] ?? "";
|
|
|
- $dispatch_t = $dispatch_no[$value['dispatch_sub_id']] ?? "";
|
|
|
+ $dispatch_t = $dispatch_no[$value['report_id']] ?? "";
|
|
|
$data['data'][$key]['dispatch_no'] = $dispatch_t;
|
|
|
// $data['data'][$key]['crt_time'] = date("Y-m-d",strtotime(substr($dispatch_t,0,8)));
|
|
|
}
|
|
@@ -251,9 +251,9 @@ class ScrappService extends Service
|
|
|
$order['team_title'] = Team::where('id',$first['team_id'])->value("title");
|
|
|
$order['finished_title'] = Employee::where('id',$first['finished_id'])->value("emp_name");
|
|
|
$order['equipment_title'] = Equipment::where('id',$first['equipment_id'])->value("title");
|
|
|
- $dispatch = DispatchSub::where('id',$first['dispatch_sub_id'])->first();
|
|
|
+ $dispatch = ReportWorking::where('id',$first['report_id'])->first();
|
|
|
$dispatch = empty($dispatch) ? [] : $dispatch->toArray();
|
|
|
- $order['dispatch_no'] = $dispatch['dispatch_no'] ?? "";
|
|
|
+ $order['dispatch_no'] = $dispatch['order_number'] ?? "";
|
|
|
$order['crt_time'] = date("Y-m-d", $first['crt_time']);
|
|
|
|
|
|
$team_man = EmployeeTeamPermission::where('team_id',$first['team_id'])
|
|
@@ -327,7 +327,7 @@ class ScrappService extends Service
|
|
|
public function blpList($data, $user){
|
|
|
$model = ScrappCount::where('del_time',0)
|
|
|
->where('scrapp_num','>',0)
|
|
|
- ->select('id','dispatch_sub_id','crt_time','team_id','finished_id','equipment_id','order_number','process_id','sale_orders_product_id')
|
|
|
+ ->select('id','dispatch_sub_id','crt_time','team_id','finished_id','equipment_id','order_number','process_id','sale_orders_product_id','report_id')
|
|
|
->orderBy('dispatch_sub_id','desc')
|
|
|
->groupBy('order_number');
|
|
|
|
|
@@ -397,8 +397,8 @@ class ScrappService extends Service
|
|
|
$sales_number = SaleOrdersProduct::whereIn('id',array_unique(array_column($data['data'],'sale_orders_product_id')))
|
|
|
->pluck('out_order_no','id')
|
|
|
->toArray();
|
|
|
- $dispatch_no = DispatchSub::whereIn('id',array_column($data['data'], 'dispatch_sub_id'))
|
|
|
- ->pluck('dispatch_no','id')
|
|
|
+ $dispatch_no = ReportWorking::whereIn('id',array_column($data['data'], 'report_id'))
|
|
|
+ ->pluck('order_number','id')
|
|
|
->toArray();
|
|
|
foreach ($data['data'] as $key => $value){
|
|
|
$data['data'][$key]['crt_time'] = $value['crt_time'] ? date("Y-m-d", $value['crt_time']) : '';
|
|
@@ -408,7 +408,7 @@ class ScrappService extends Service
|
|
|
$data['data'][$key]['equipment_title'] = $equipment_map[$value['equipment_id']] ?? '';
|
|
|
$data['data'][$key]['process_title'] = $process_map[$value['process_id']] ?? '';
|
|
|
$data['data'][$key]['sale_order_number'] = $sales_number[$value['sale_orders_product_id']] ?? "";
|
|
|
- $dispatch_t = $dispatch_no[$value['dispatch_sub_id']] ?? "";
|
|
|
+ $dispatch_t = $dispatch_no[$value['report_id']] ?? "";
|
|
|
$data['data'][$key]['dispatch_no'] = $dispatch_t;
|
|
|
// $data['data'][$key]['crt_time'] = date("Y-m-d",strtotime(substr($dispatch_t,0,8)));
|
|
|
}
|
|
@@ -429,9 +429,9 @@ class ScrappService extends Service
|
|
|
$order['team_title'] = Team::where('id',$first['team_id'])->value("title");
|
|
|
$order['finished_title'] = Employee::where('id',$first['finished_id'])->value("emp_name");
|
|
|
$order['equipment_title'] = Equipment::where('id',$first['equipment_id'])->value("title");
|
|
|
- $dispatch = DispatchSub::where('id',$first['dispatch_sub_id'])->first();
|
|
|
+ $dispatch = ReportWorking::where('id',$first['report_id'])->first();
|
|
|
$dispatch = empty($dispatch) ? [] : $dispatch->toArray();
|
|
|
- $order['dispatch_no'] = $dispatch['dispatch_no'] ?? "";
|
|
|
+ $order['dispatch_no'] = $dispatch['order_number'] ?? "";
|
|
|
$order['crt_time'] = date("Y-m-d",$first['crt_time']);
|
|
|
|
|
|
$team_man = EmployeeTeamPermission::where('team_id',$first['team_id'])
|