浏览代码

[智价云] 修复责任人错误问题2

tangyuanwang 2 天之前
父节点
当前提交
dc5085032b
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      app/Jobs/Manager/Process/ViolationProductDataJobs.php

+ 3 - 5
app/Jobs/Manager/Process/ViolationProductDataJobs.php

@@ -432,27 +432,25 @@ class ViolationProductDataJobs implements ShouldQueue
         if ($specify_responsible_person == 0) {
             //获取店铺责任人信息
             $ViolationStoreModel = new ViolationStoreModel();
-            $store_data_info = $ViolationStoreModel->where('company_id', $company_id)->where('store_name', $product_data['store_name'])->first();
+            $store_data_info = $ViolationStoreModel->where('company_id', $company_id)->where('store_name', $product_data['store_name'])->where('status','0')->first();
             if (!empty($store_data_info) && trim($store_data_info->employee_ids) != '') {
                 //查询店铺第一责任人信息
                 $EmployeeModel = new EmployeeModel();
                 $store_where_query = [];
                 $employee_id_store = explode(',', $store_data_info->employee_ids);
                 $store_where_query[] = ['company_id', '=', $company_id];
-                $store_where_query[] = ['id', 'in', $employee_id_store];
                 $store_where_query[] = ['status', '=', 0];
                 $store_where_query[] = ['duty_type', '=', 1]; //责任类型1=第一责任人,2=责任人
-                $first_responsible_person = $EmployeeModel->where($store_where_query)->pluck('id')->implode(',');
+                $first_responsible_person = $EmployeeModel->whereIn('id',$employee_id_store)->where($store_where_query)->pluck('id')->implode(',');
                 $insert_product_data['first_responsible_person'] = $first_responsible_person;
                 //查询店铺责任人信息
                 $EmployeeModel = new EmployeeModel();
                 $store_where_query = [];
                 $employee_id_store = explode(',', $store_data_info->employee_ids);
                 $store_where_query[] = ['company_id', '=', $company_id];
-                $store_where_query[] = ['id', 'in', $employee_id_store];
                 $store_where_query[] = ['status', '=', 0];
                 $store_where_query[] = ['duty_type', '=', 2]; //责任类型1=第一责任人,2=责任人
-                $responsible_person = $EmployeeModel->where($store_where_query)->pluck('id')->implode(',');
+                $responsible_person = $EmployeeModel->whereIn('id',$employee_id_store)->where($store_where_query)->pluck('id')->implode(',');
                 $insert_product_data['responsible_person'] = $responsible_person;
                 //溯源责任人
                 $source_responsible_person = '';