|
@@ -310,13 +310,13 @@ class ConstructionService extends Service
|
|
|
ProductInventoryService::changeLockNumber($user,[],$product_save);
|
|
|
|
|
|
//排班修改
|
|
|
- $schedule = ScheduleInfo::where('del_time',0)
|
|
|
- ->where('schedule_id',$construction['schedule_id'])
|
|
|
- ->where('start_time',$construction['day_start_stamp'])
|
|
|
- ->where('end_time',$construction['day_end_stamp'])
|
|
|
- ->where('is_use','>', ScheduleInfo::not_use)
|
|
|
- ->first();
|
|
|
- if(! empty($schedule)) ScheduleInfo::where('id',$schedule->id)->update(['is_use' => ScheduleInfo::not_use]);
|
|
|
+// $schedule = ScheduleInfo::where('del_time',0)
|
|
|
+// ->where('schedule_id',$construction['schedule_id'])
|
|
|
+// ->where('start_time',$construction['day_start_stamp'])
|
|
|
+// ->where('end_time',$construction['day_end_stamp'])
|
|
|
+// ->where('is_use','>', ScheduleInfo::not_use)
|
|
|
+// ->first();
|
|
|
+// if(! empty($schedule)) ScheduleInfo::where('id',$schedule->id)->update(['is_use' => ScheduleInfo::not_use]);
|
|
|
|
|
|
DB::commit();
|
|
|
}catch (\Exception $exception){
|
|
@@ -474,10 +474,11 @@ class ConstructionService extends Service
|
|
|
public function constructionList($data,$user){
|
|
|
$model = Construction::Clear($user,$data);
|
|
|
$model = $model->where('del_time',0)
|
|
|
- ->select('title','id','model_type','order_number','customer_id','customer_contact_id','install_method','install_position','sales_order_id','construction_fee','construction_time','handover_time','urgency','crt_id','crt_time','mark','state','address1','address2','introduction','service_price','storehouse_id','start_time','end_time')
|
|
|
+ ->select('title','id','model_type','order_number','customer_id','customer_contact_id','install_method','install_position','sales_order_id','construction_fee','construction_time','handover_time','urgency','crt_id','crt_time','mark','state','address1','address2','introduction','service_price','storehouse_id','start_time','end_time','pq_state','day_start_stamp','day_end_stamp')
|
|
|
->orderby('id', 'desc');
|
|
|
|
|
|
if(isset($data['state'])) $model->where('state', $data['state']);
|
|
|
+ if(isset($data['pq_state'])) $model->where('pq_state', $data['pq_state']);
|
|
|
if(! empty($data['title'])) $model->where('title', 'LIKE', '%'.$data['title'].'%');
|
|
|
if(! empty($data['model_type'])) $model->where('model_type',$data['model_type']);
|
|
|
if(! empty($data['time_type'])) {
|
|
@@ -498,6 +499,10 @@ class ConstructionService extends Service
|
|
|
$model->where('start_time','>=',$return[0]);
|
|
|
$model->where('end_time','<=',$return[1]);
|
|
|
}
|
|
|
+ if(! empty($data['pq_period'][0]) && ! empty($data['pq_period'][1])) {
|
|
|
+ $model->where('day_start_stamp','>=',$this->changeDateToDateMin($data['pq_period'][0]));
|
|
|
+ $model->where('day_end_stamp','<=',$this->changeDateToDateMin($data['pq_period'][1]));
|
|
|
+ }
|
|
|
if(! empty($data['sale_order'])){
|
|
|
$model2 = SalesOrder::Clear($user,$data);
|
|
|
$sale = $model2->where('del_time',0)
|
|
@@ -713,6 +718,12 @@ class ConstructionService extends Service
|
|
|
$data['data'][$key]['handover_time'] = $tmp_sales_time;
|
|
|
$data['data'][$key]['storehouse_title'] = $storehouse[$value['storehouse_id']] ?? '';
|
|
|
$data['data'][$key]['dispatch_company'] = $dispatch[$value['sales_order_id']] ?? '';
|
|
|
+ $data['data'][$key]['pq_state_title'] = Construction::$pq_name[$value['pq_state']] ?? '';
|
|
|
+ $str = "";
|
|
|
+ $start_time = $value['day_start_stamp'] ? date("Y-m-d H:i",$value['day_start_stamp']) : '';
|
|
|
+ $end_time = $value['day_end_stamp'] ? date("Y-m-d H:i",$value['day_end_stamp']) : '';
|
|
|
+ if(! empty($start_time) && ! empty($end_time)) $str = $start_time . '——' . $end_time;
|
|
|
+ $data['data'][$key]['pq_period'] = $str;
|
|
|
}
|
|
|
|
|
|
return $data;
|