|
@@ -155,6 +155,32 @@ class ApplyOrderService extends Service
|
|
|
if(! empty($data['crt_id'])) $model->where('crt_id', $data['crt_id']);
|
|
|
if(! empty($data['apply_time'][0]) && ! empty($data['apply_time'][1])) $model->whereBetween('apply_time',[$data['apply_time'][0],$data['apply_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_no'])){
|
|
|
+ $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 = ApplyOrderDetail::where('del_time',0)
|
|
|
+ ->where('type', $data['type'])
|
|
|
+ ->whereIn('data_id', $dispatch_id)
|
|
|
+ ->select('apply_order_id')
|
|
|
+ ->get()->toArray();
|
|
|
+ $model->whereIn('id', array_unique(array_column($detail,'apply_order_id')));
|
|
|
+ }
|
|
|
+ if(! empty($data['box_no'])){
|
|
|
+ $box_id = Box::where('del_time',0)
|
|
|
+ ->where('order_no', 'LIKE', '%'.$data['box_no'].'%')
|
|
|
+ ->select('id')
|
|
|
+ ->get()->toArray();
|
|
|
+ $box_id = array_column($box_id,'id');
|
|
|
+ $detail = ApplyOrderDetail::where('del_time',0)
|
|
|
+ ->where('type', $data['type'])
|
|
|
+ ->whereIn('data_id', $box_id)
|
|
|
+ ->select('apply_order_id')
|
|
|
+ ->get()->toArray();
|
|
|
+ $model->whereIn('id', array_unique(array_column($detail,'apply_order_id')));
|
|
|
+ }
|
|
|
|
|
|
$list = $this->limit($model,'',$data);
|
|
|
$list = $this->fillData($list);
|
|
@@ -620,6 +646,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_no'])) {
|
|
|
+ $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')));
|
|
|
+ }
|
|
|
|
|
|
$list = $this->limit($model,'',$data);
|
|
|
$list = $this->reportWorkingfillData($list);
|