Forráskód Böngészése

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

tangyuanwang 2 napja
szülő
commit
a7f7162286

+ 8 - 14
app/Jobs/Manager/Process/LowPriceGoodsDataJobs.php

@@ -252,25 +252,22 @@ class LowPriceGoodsDataJobs implements ShouldQueue
                     if (!empty($employee_id_list)) {
                     if (!empty($employee_id_list)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->orWhereIn('id', $employee_id_list)
                             ->orWhereIn('id', $employee_id_list)
-                            ->where('status', 0)
-                            ->where('duty_type', 1);
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                     if (!empty($employee_id_area)) {
                     if (!empty($employee_id_area)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_area)
                             ->whereIn('id', $employee_id_area)
-                            ->where('status', 0)
-                            ->where('duty_type', 1);
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                     if (!empty($employee_id_platform)) {
                     if (!empty($employee_id_platform)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_platform)
                             ->whereIn('id', $employee_id_platform)
-                            ->where('status', 0)
-                            ->where('duty_type', 1);
+                            ->where('status', 0);
                     }
                     }
                 });
                 });
-                $first_responsible_person = $EmployeeModel->pluck('id')->implode(',');
+                $first_responsible_person = $EmployeeModel->where('duty_type', 1)->pluck('id')->implode(',');
 
 
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 if (trim($first_responsible_person) == '' && trim($product_data['shipment_city_id']) != '') {
                 if (trim($first_responsible_person) == '' && trim($product_data['shipment_city_id']) != '') {
@@ -320,25 +317,22 @@ class LowPriceGoodsDataJobs implements ShouldQueue
                     if (!empty($employee_id_list)) {
                     if (!empty($employee_id_list)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->orWhereIn('id', $employee_id_list)
                             ->orWhereIn('id', $employee_id_list)
-                            ->where('status', 0)
-                            ->where('duty_type', 2); //责任类型1=第一责任人,2=责任人
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                     if (!empty($employee_id_area)) {
                     if (!empty($employee_id_area)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_area)
                             ->whereIn('id', $employee_id_area)
-                            ->where('status', 0)
-                            ->where('duty_type', 2); //责任类型1=第一责任人,2=责任人
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                     if (!empty($employee_id_platform)) {
                     if (!empty($employee_id_platform)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_platform)
                             ->whereIn('id', $employee_id_platform)
-                            ->where('status', 0)
-                            ->where('duty_type', 2); //责任类型1=第一责任人,2=责任人
+                            ->where('status', 0);
                     }
                     }
                 });
                 });
-                $responsible_person = $EmployeeModel->pluck('id')->implode(',');
+                $responsible_person = $EmployeeModel->where('duty_type', 2)->pluck('id')->implode(',');
 
 
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 if (trim($responsible_person) == '' && trim($product_data['shipment_city_id']) != '') {
                 if (trim($responsible_person) == '' && trim($product_data['shipment_city_id']) != '') {

+ 12 - 18
app/Jobs/Manager/Process/ViolationProductDataJobs.php

@@ -202,10 +202,10 @@ class ViolationProductDataJobs implements ShouldQueue
                 'shipment_city_name' => $product_data['shipment_city_name'],
                 'shipment_city_name' => $product_data['shipment_city_name'],
             ];
             ];
             //获取公司绑定责任人信息
             //获取公司绑定责任人信息
-            $company_data = $ViolationStoreModel->leftjoin('washconfig_company_category', 'washconfig_company_category.id', '=', 'washconfig_violation_store.category_id')
-                ->where('washconfig_violation_store.social_credit_code', $product_data['qualification_number'])
-                ->where('washconfig_violation_store.company_id', $company_id)
-                ->select(['washconfig_violation_store.id', 'washconfig_company_category.name as category_name'])->first();
+            $company_data = $ViolationStoreModel->leftjoin('washconfig_company_category', 'washconfig_company_category.id', '=', 'washconfig_violation_company.category_id')
+                ->where('washconfig_violation_company.social_credit_code', $product_data['qualification_number'])
+                ->where('washconfig_violation_company.company_id', $company_id)
+                ->select(['washconfig_violation_company.id', 'washconfig_company_category.name as category_name'])->first();
             $employee_id_list = [];
             $employee_id_list = [];
             if ($company_data) {
             if ($company_data) {
                 $employee_id_list = $ViolationCompanyMemberModel->where('company_logid', $company_data->id)->pluck('employee_id')->toarray();
                 $employee_id_list = $ViolationCompanyMemberModel->where('company_logid', $company_data->id)->pluck('employee_id')->toarray();
@@ -244,25 +244,22 @@ class ViolationProductDataJobs implements ShouldQueue
                     if (!empty($employee_id_list)) {
                     if (!empty($employee_id_list)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->orWhereIn('id', $employee_id_list)
                             ->orWhereIn('id', $employee_id_list)
-                            ->where('status', 0)
-                            ->where('duty_type', 1);
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                     if (!empty($employee_id_area)) {
                     if (!empty($employee_id_area)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_area)
                             ->whereIn('id', $employee_id_area)
-                            ->where('status', 0)
-                            ->where('duty_type', 1);
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                     if (!empty($employee_id_platform)) {
                     if (!empty($employee_id_platform)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_platform)
                             ->whereIn('id', $employee_id_platform)
-                            ->where('status', 0)
-                            ->where('duty_type', 1);
+                            ->where('status', 0);
                     }
                     }
                 });
                 });
-                $first_responsible_person = $EmployeeModel->pluck('id')->implode(',');
+                $first_responsible_person = $EmployeeModel->where('duty_type', 1)->pluck('id')->implode(',');
 
 
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 if (trim($first_responsible_person) == '' && trim($product_data['shipment_city_id']) !='') {
                 if (trim($first_responsible_person) == '' && trim($product_data['shipment_city_id']) !='') {
@@ -311,25 +308,22 @@ class ViolationProductDataJobs implements ShouldQueue
                     if (!empty($employee_id_list)) {
                     if (!empty($employee_id_list)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->orWhereIn('id', $employee_id_list)
                             ->orWhereIn('id', $employee_id_list)
-                            ->where('status', 0)
-                            ->where('duty_type', 2);//责任类型1=第一责任人,2=责任人
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_area, $company_id) {
                     if (!empty($employee_id_area)) {
                     if (!empty($employee_id_area)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_area)
                             ->whereIn('id', $employee_id_area)
-                            ->where('status', 0)
-                            ->where('duty_type', 2);//责任类型1=第一责任人,2=责任人
+                            ->where('status', 0);
                     }
                     }
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                 })->orWhere(function ($q) use ($employee_id_platform, $company_id) {
                     if (!empty($employee_id_platform)) {
                     if (!empty($employee_id_platform)) {
                         $q->where('company_id', $company_id)
                         $q->where('company_id', $company_id)
                             ->whereIn('id', $employee_id_platform)
                             ->whereIn('id', $employee_id_platform)
-                            ->where('status', 0)
-                            ->where('duty_type', 2);//责任类型1=第一责任人,2=责任人
+                            ->where('status', 0);
                     }
                     }
                 });
                 });
-                $responsible_person = $EmployeeModel->pluck('id')->implode(',');
+                $responsible_person = $EmployeeModel->where('duty_type', 2)->pluck('id')->implode(',');
 
 
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 //当以上规则匹配不到责任人时,则去查询发货地区信息关联责任人
                 if (trim($responsible_person) == '' && trim($product_data['shipment_city_id']) !='') {
                 if (trim($responsible_person) == '' && trim($product_data['shipment_city_id']) !='') {