|
|
@@ -343,12 +343,12 @@ class ViolationCompanyDataJobs implements ShouldQueue
|
|
|
if (trim($first_responsible_person) == '' && trim($product_data['shipment_city_id']) != '') {
|
|
|
$employee_id_area = $EmployeeAreaModel->where('company_id',$company_id)->where('city_id', $product_data['shipment_city_id'])->pluck('employee_id')->toarray();
|
|
|
if (!empty($employee_id_area)) {
|
|
|
+ $where_city =[];
|
|
|
$where_city[] = ['company_id', '=', $company_id];
|
|
|
- $where_city[] = ['id', 'in', $employee_id_area];
|
|
|
$where_city[] = ['status', '=', 0];
|
|
|
$where_city[] = ['duty_type', '=', 1]; //责任类型1=第一责任人,2=责任人
|
|
|
$EmployeeModel = new EmployeeModel();
|
|
|
- $first_responsible_person = $EmployeeModel->where($where_city)->pluck('id')->implode(',');
|
|
|
+ $first_responsible_person = $EmployeeModel->whereIn('id',$employee_id_area)->where($where_city)->pluck('id')->implode(',');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -412,12 +412,12 @@ class ViolationCompanyDataJobs implements ShouldQueue
|
|
|
if (trim($responsible_person) == '' && trim($product_data['shipment_city_id']) != '') {
|
|
|
$employee_id_area = $EmployeeAreaModel->where('company_id',$company_id)->where('city_id', $product_data['shipment_city_id'])->pluck('employee_id')->toarray();
|
|
|
if (!empty($employee_id_area)) {
|
|
|
+ $where_city =[];
|
|
|
$where_city[] = ['company_id', '=', $company_id];
|
|
|
- $where_city[] = ['id', 'in', $employee_id_area];
|
|
|
$where_city[] = ['status', '=', 0];
|
|
|
$where_city[] = ['duty_type', '=', 2]; //责任类型1=第一责任人,2=责任人
|
|
|
$EmployeeModel = new EmployeeModel();
|
|
|
- $responsible_person = $EmployeeModel->where($where_city)->pluck('id')->implode(',');
|
|
|
+ $responsible_person = $EmployeeModel->whereIn('id',$employee_id_area)->where($where_city)->pluck('id')->implode(',');
|
|
|
}
|
|
|
}
|
|
|
$insert_product_data['responsible_person'] = $responsible_person;
|