|
@@ -4273,13 +4273,21 @@ class ApplyOrderService extends Service
|
|
|
}elseif ($for_type == 3){
|
|
|
$dispatch_id = ScrappCount::where('del_time',0)
|
|
|
->where('id', $id)
|
|
|
- ->pluck('dispatch_sub_id')
|
|
|
- ->toArray();
|
|
|
- $result = DispatchSub::where('del_time',0)
|
|
|
- ->whereIn('id', $dispatch_id)
|
|
|
- ->where('type',1)
|
|
|
- ->select('id', 'dispatch_no as order_no')
|
|
|
- ->get()->toArray();
|
|
|
+ ->select('order_product_id','crt_time','process_id','scrapp_num as num')
|
|
|
+ ->first();
|
|
|
+ if(! empty($dispatch_id)){
|
|
|
+ $dispatch_id = $dispatch_id->toArray();
|
|
|
+ $result = DispatchSub::where('del_time',0)
|
|
|
+// ->where('order_product_id', $dispatch_id['order_product_id'])
|
|
|
+ ->where('crt_time', $dispatch_id['crt_time'])
|
|
|
+ ->where('process_id', $dispatch_id['process_id'])
|
|
|
+ ->where('dispatch_quantity', $dispatch_id['num'])
|
|
|
+ ->where('type',1)
|
|
|
+ ->select('id', 'dispatch_no as order_no')
|
|
|
+ ->limit(1)
|
|
|
+ ->get()->toArray();
|
|
|
+ }
|
|
|
+
|
|
|
}elseif ($for_type == 4){
|
|
|
$report_id = ScrappCount::where('del_time',0)
|
|
|
->where('id', $id)
|