|
@@ -739,6 +739,18 @@ class ApplyOrderService extends Service
|
|
|
if(! empty($data['crt_id'])) $model->where('crt_id', $data['crt_id']);
|
|
|
if(! empty($data['report_time'][0]) && ! empty($data['report_time'][1])) $model->whereBetween('report_time',[$data['report_time'][0],$data['report_time'][1]]);
|
|
|
if(! empty($data['crt_time'][0]) && ! empty($data['crt_time'][1])) $model->whereBetween('crt_time',[$data['crt_time'][0],$data['crt_time'][1]]);
|
|
|
+ if(! empty($data['dispatch_no1'])) {
|
|
|
+ $dispatch_id = DispatchSub::where('del_time',0)
|
|
|
+ ->where('dispatch_no', 'LIKE', '%'.$data['dispatch_no'].'%')
|
|
|
+ ->select('id')
|
|
|
+ ->get()->toArray();
|
|
|
+ $dispatch_id = array_column($dispatch_id,'id');
|
|
|
+ $detail = ReportWorkingDetail::where('del_time',0)
|
|
|
+ ->whereIn('data_id', $dispatch_id)
|
|
|
+ ->select('report_working_id')
|
|
|
+ ->get()->toArray();
|
|
|
+ $model->whereIn('id', array_unique(array_column($detail,'report_working_id')));
|
|
|
+ }
|
|
|
if(! empty($data['dispatch_no'])) {
|
|
|
$dispatch_id = DispatchSub::where('del_time',0)
|
|
|
->where('dispatch_no', 'LIKE', '%'.$data['dispatch_no'].'%')
|