|
|
@@ -246,23 +246,25 @@ class ViolationStoreDataJobs implements ShouldQueue
|
|
|
$employee_id_list = explode(',', $employee_ids);
|
|
|
//获取指定人员信息
|
|
|
if ($specify_responsible_person == 0) {
|
|
|
+ $first_responsible_person ='';
|
|
|
//查询第一责任人
|
|
|
if (!empty($employee_id_list)) {
|
|
|
$where_query1[] = ['company_id', '=', $company_id];
|
|
|
$where_query1[] = ['id', 'in', $employee_id_list];
|
|
|
$where_query1[] = ['status', '=', 0];
|
|
|
$where_query1[] = ['duty_type', '=', 1]; //责任类型1=第一责任人,2=责任人
|
|
|
+ $first_responsible_person = $EmployeeModel->where($where_query1)->pluck('id')->implode(',');
|
|
|
}
|
|
|
- $first_responsible_person = $EmployeeModel->pluck('id')->implode(',');
|
|
|
$insert_product_data['first_responsible_person'] = $first_responsible_person;
|
|
|
//查询责任人
|
|
|
+ $responsible_person ='';
|
|
|
if (!empty($employee_id_list)) {
|
|
|
- $where_query1[] = ['company_id', '=', $company_id];
|
|
|
- $where_query1[] = ['id', 'in', $employee_id_list];
|
|
|
- $where_query1[] = ['status', '=', 0];
|
|
|
- $where_query1[] = ['duty_type', '=', 2]; //责任类型1=第一责任人,2=责任人
|
|
|
+ $where_query2[] = ['company_id', '=', $company_id];
|
|
|
+ $where_query2[] = ['id', 'in', $employee_id_list];
|
|
|
+ $where_query2[] = ['status', '=', 0];
|
|
|
+ $where_query2[] = ['duty_type', '=', 2]; //责任类型1=第一责任人,2=责任人
|
|
|
+ $responsible_person = $EmployeeModel->where($where_query2)->pluck('id')->implode(',');
|
|
|
}
|
|
|
- $responsible_person = $EmployeeModel->pluck('id')->implode(',');
|
|
|
$insert_product_data['responsible_person'] = $responsible_person;
|
|
|
|
|
|
//溯源责任人
|