|
@@ -80,6 +80,7 @@ class ExportViolationProductJobs implements ShouldQueue
|
|
|
public function export_excel($message_data)
|
|
public function export_excel($message_data)
|
|
|
{
|
|
{
|
|
|
$ViolationProductModel = new ViolationProductModel();
|
|
$ViolationProductModel = new ViolationProductModel();
|
|
|
|
|
+ $EmployeeModel = new EmployeeModel();
|
|
|
$admin_company_id = $message_data['admin_company_id'];
|
|
$admin_company_id = $message_data['admin_company_id'];
|
|
|
$company_id = $message_data['company_id'];
|
|
$company_id = $message_data['company_id'];
|
|
|
$is_admin = $message_data['is_admin']; //是否管理员操作 0=是1=否
|
|
$is_admin = $message_data['is_admin']; //是否管理员操作 0=是1=否
|
|
@@ -217,7 +218,13 @@ class ExportViolationProductJobs implements ShouldQueue
|
|
|
$key_name = 'ExportViolationProductJobs_' . $violation_product_where['company_id'];
|
|
$key_name = 'ExportViolationProductJobs_' . $violation_product_where['company_id'];
|
|
|
//创建缓存
|
|
//创建缓存
|
|
|
Cache::put($key_name, [], 60 * 60 * 24);
|
|
Cache::put($key_name, [], 60 * 60 * 24);
|
|
|
-
|
|
|
|
|
|
|
+ $personnel_roles_info = $EmployeeModel->leftjoin('personnel_roles', 'personnel_roles.id', '=', 'personnel_employee.role_id')
|
|
|
|
|
+ ->where('personnel_employee.id', $user_id)->select(['personnel_employee.id', 'personnel_roles.identity'])
|
|
|
|
|
+ ->first();
|
|
|
|
|
+ //角色身份1=普通2=管理员
|
|
|
|
|
+ if(!empty($personnel_roles_info) && $personnel_roles_info->identity == 2){
|
|
|
|
|
+ $is_admin = 1;
|
|
|
|
|
+ }
|
|
|
$query = $ViolationProductModel->where($map);
|
|
$query = $ViolationProductModel->where($map);
|
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
|
$query = $query->where(function ($q) use ($user_id) {
|
|
$query = $query->where(function ($q) use ($user_id) {
|