|
|
@@ -202,10 +202,10 @@ class ViolationProductDataJobs implements ShouldQueue
|
|
|
'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 = [];
|
|
|
if ($company_data) {
|
|
|
$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)) {
|
|
|
$q->where('company_id', $company_id)
|
|
|
->orWhereIn('id', $employee_id_list)
|
|
|
- ->where('status', 0)
|
|
|
- ->where('duty_type', 1);
|
|
|
+ ->where('status', 0);
|
|
|
}
|
|
|
})->orWhere(function ($q) use ($employee_id_area, $company_id) {
|
|
|
if (!empty($employee_id_area)) {
|
|
|
$q->where('company_id', $company_id)
|
|
|
->whereIn('id', $employee_id_area)
|
|
|
- ->where('status', 0)
|
|
|
- ->where('duty_type', 1);
|
|
|
+ ->where('status', 0);
|
|
|
}
|
|
|
})->orWhere(function ($q) use ($employee_id_platform, $company_id) {
|
|
|
if (!empty($employee_id_platform)) {
|
|
|
$q->where('company_id', $company_id)
|
|
|
->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']) !='') {
|
|
|
@@ -311,25 +308,22 @@ class ViolationProductDataJobs implements ShouldQueue
|
|
|
if (!empty($employee_id_list)) {
|
|
|
$q->where('company_id', $company_id)
|
|
|
->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) {
|
|
|
if (!empty($employee_id_area)) {
|
|
|
$q->where('company_id', $company_id)
|
|
|
->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) {
|
|
|
if (!empty($employee_id_platform)) {
|
|
|
$q->where('company_id', $company_id)
|
|
|
->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']) !='') {
|