소스 검색

[智价云] 责任人信息更新

tangyuanwang 2 일 전
부모
커밋
eb7098ba42
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 6
      app/Jobs/Manager/Process/ViolationStoreDataJobs.php

+ 8 - 6
app/Jobs/Manager/Process/ViolationStoreDataJobs.php

@@ -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;
 
                 //溯源责任人