فهرست منبع

[智价云] 数据隔离临时提交

tangyuanwang 1 ماه پیش
والد
کامیت
d1a621ff04

+ 2 - 4
app/Http/Controllers/Manager/Process/LowPriceGoods.php

@@ -691,14 +691,12 @@ class LowPriceGoods extends Controller
         $company_id = request('access_token.company_id', '0');
         $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         $admin_id   = request('access_token.uid', 0); //用户ID
-        $select_company_id = 0;
         // 权限判断
         if ($is_admin != 1 && $company_id != 0) {
-            $select_company_id = $company_id;
         } else {
-            $select_company_id  = $admin_company_id;
+            $company_id  = $admin_company_id;
         }
-        $message_data = ['page' => '1', 'limit' => 50, 'admin_id' => $admin_id,'is_admin' => $is_admin,'select_company_id' => $select_company_id];
+        $message_data = ['page' => '1', 'limit' => 50, 'admin_id' => $admin_id,'is_admin' => $is_admin,'company_id' => $company_id];
         LowPriceGoodsJobs::dispatch($message_data);
         // LowPriceGoodsJobs::dispatchSync($message_data);
         // 告知结果

+ 32 - 4
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -620,8 +620,18 @@ class ViolationProduct extends Controller
         $processing_status = request('processing_status', 0);
         // 查询用户
         $where = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $where['company_id'] = $company_id;
+        } else {
+            $where['company_id'] = $admin_company_id;
+        }
+        $ViolationProduct = $ViolationProductModel->where($where)->first();
+        if (!$ViolationProduct) return json_send(['code' => 'error', 'msg' => '记录不存在']);
+        $ViolationProduct->processing_status = $processing_status;
+        $ViolationProduct->update_time = time();
         // 执行修改
-        $result            =  $ViolationProductModel->changeProcessingStatus($where, $processing_status);
+        $result            =  $ViolationProduct->save();
         // 提示新增失败
         if (!$result)    return json_send(['code' => 'error', 'msg' => '设置失败']);
         // 告知结果
@@ -646,8 +656,16 @@ class ViolationProduct extends Controller
         $id = request('id', 0);
         // 查询用户
         $where = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $where['company_id'] = $company_id;
+        } else {
+            $where['company_id'] = $admin_company_id;
+        }
+        $ViolationProduct = $ViolationProductModel->where($where)->first();
+        if (!$ViolationProduct) return json_send(['code' => 'error', 'msg' => '记录不存在']);
         // 执行删除
-        $result =  $ViolationProductModel->deleteViolationProduct($where);
+        $result =  $ViolationProduct->delete();
         // 提示删除失败
         if (!$result)    return json_send(['code' => 'error', 'msg' => '删除失败']);
         // 告知结果
@@ -669,8 +687,12 @@ class ViolationProduct extends Controller
         $company_id = request('access_token.company_id', '0');
         $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         $admin_id   = request('access_token.uid', 0); //用户ID
-        $is_admin   = request('access_token.is_admin'); //是否管理员操作 0=是1=否
-        $message_data = ['page' => '1', 'limit' => 50, 'admin_id' => $admin_id, 'is_admin' => $is_admin];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+        } else {
+            $company_id  = $admin_company_id;
+        }
+        $message_data = ['page' => '1', 'limit' => 50, 'admin_id' => $admin_id, 'is_admin' => $is_admin,'company_id' => $company_id];
         ViolationProductJobs::dispatch($message_data);
         // ViolationProductJobs::dispatchSync($message_data);
         // 告知结果
@@ -798,6 +820,12 @@ class ViolationProduct extends Controller
             if($city_name && !strpos($city_name,'市')){
                 $city_name = $city_name.'市';
             }
+            // 权限判断
+            if ($is_admin != 1 && $company_id != 0) {
+                $insert_product_data['company_id'] = $company_id;
+            } else {
+                $insert_product_data['company_id']  = $admin_company_id;
+            }
             $insert_product_data['first_responsible_person'] = !empty($first_responsible_person_id) ? implode(',', $first_responsible_person_id) : ''; //第一责任人ID集合
             $insert_product_data['responsible_person'] = !empty($responsible_person_id) ? implode(',', $responsible_person_id) : ''; //责任人ID集合
             $insert_product_data['platform'] = isset($platform_data[$item[2]]) ? $platform_data[$item[2]] : '0'; // 平台

+ 89 - 2
app/Http/Controllers/Manager/Process/ViolationStore.php

@@ -30,6 +30,9 @@ class ViolationStore extends Controller
     public function list(Request $request, ViolationStoreModel $ViolationStoreModel, EmployeeModel $EmployeeModel, ViolationStoreMemberModel $ViolationStoreMemberModel)
     {
         $request->scene('list')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 查询条件
         $map  = [];
         $limit = request('limit', config('page_num', 10));
@@ -54,6 +57,14 @@ class ViolationStore extends Controller
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
         if ($company_name) $map[]   = ['company_name', 'like', "%$company_name%"];
 
+        $violation_store_where = [];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $violation_store_where['company_id'] = $company_id;
+        } else {
+            $violation_store_where['company_id']  = $admin_company_id;
+        }
+        $ViolationStoreModel = $ViolationStoreModel->where($violation_store_where);
         //多选平台查询
         if ($platform && is_string($platform)) {
             $platform = explode(',', $platform);
@@ -149,6 +160,9 @@ class ViolationStore extends Controller
     public function export_excel(Request $request,  ViolationStoreModel $ViolationStoreModel, EmployeeModel $EmployeeModel, ViolationStoreMemberModel $ViolationStoreMemberModel)
     {
         $request->scene('export_excel')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 查询条件
         $map  = [];
         $limit = request('limit', config('page_num', 10));
@@ -171,6 +185,14 @@ class ViolationStore extends Controller
         //其它条件
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
 
+        $violation_store_where = [];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $violation_store_where['company_id'] = $company_id;
+        } else {
+            $violation_store_where['company_id']  = $admin_company_id;
+        }
+        $ViolationStoreModel = $ViolationStoreModel->where($violation_store_where);
         //多选平台查询
         if ($platform && is_string($platform)) {
             $platform = explode(',', $platform);
@@ -401,9 +423,18 @@ class ViolationStore extends Controller
     public function detail(Request $request, ViolationStoreModel $ViolationStoreModel, EmployeeModel $EmployeeModel)
     {
         $request->scene('detail')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 接收参数
         $id = request('id', 0);
         $map = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $map['company_id'] = $company_id;
+        } else {
+            $map['company_id']  = $admin_company_id;
+        }
         $data = $ViolationStoreModel->where($map)->first();
         if (!$data)     return json_send(['code' => 'error', 'msg' => '记录不存在']);
         //查询第一责任人名称
@@ -432,12 +463,23 @@ class ViolationStore extends Controller
     public function add(Request $request, ViolationStoreModel $ViolationStoreModel)
     {
         $request->scene('add')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 接收数据
         $all_data = request()->all();
         $store_scope = request('store_scope', '');
         $all_data['store_scope'] = $store_scope;
         //查询是否存在
         $map = ['store_name' => $all_data['store_name'], 'company_name' => $all_data['company_name']];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $map['company_id'] = $company_id;
+            $all_data['company_id'] = $company_id;
+        } else {
+            $map['company_id']  = $admin_company_id;
+            $all_data['company_id'] = $admin_company_id;
+        }
         $data = $ViolationStoreModel->where($map)->first();
         if ($data)     return json_send(['code' => 'error', 'msg' => '记录已存在']);
         // 写入数据表
@@ -458,6 +500,9 @@ class ViolationStore extends Controller
     public function edit(Request $request, ViolationStoreModel $ViolationStoreModel)
     {
         $request->scene('edit')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 接收参数
         $id         = request('id', 0);
         // 接收数据
@@ -466,6 +511,14 @@ class ViolationStore extends Controller
         $all_data['store_scope'] = $store_scope;
         //查询是否存在
         $map = ['store_name' => $all_data['store_name'], 'company_name' => $all_data['company_name']];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $map['company_id'] = $company_id;
+            $all_data['company_id'] = $company_id;
+        } else {
+            $map['company_id']  = $admin_company_id;
+            $all_data['company_id'] = $admin_company_id;
+        }
         $data = $ViolationStoreModel->where($map)->where('id', '!=', $id)->first();
         if ($data)     return json_send(['code' => 'error', 'msg' => '记录已存在']);
         // 更新数据表
@@ -488,11 +541,20 @@ class ViolationStore extends Controller
     {
         // 验证参数
         $request->scene('set_status')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 接收数据
         $id                = request('id', 0);
         $status            = request('status', 0);
         // 查询用户
         $where = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $where['company_id'] = $company_id;
+        } else {
+            $where['company_id']  = $admin_company_id;
+        }
         // 执行修改
         $result            =  $ViolationStoreModel->changeStatus($where, $status);
         // 提示新增失败
@@ -512,11 +574,20 @@ class ViolationStore extends Controller
     {
         // 验证参数
         $request->scene('set_processing_status')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 接收数据
         $id                = request('id', 0);
         $processing_status = request('processing_status', 0);
         // 查询用户
         $where = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $where['company_id'] = $company_id;
+        } else {
+            $where['company_id']  = $admin_company_id;
+        }
         // 执行修改
         $result            =  $ViolationStoreModel->changeProcessingStatus($where, $processing_status);
         // 提示新增失败
@@ -537,10 +608,19 @@ class ViolationStore extends Controller
     {
         // 验证参数
         $request->scene('delete')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         // 接收数据
         $id = request('id', 0);
         // 查询用户
         $where = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $where['company_id'] = $company_id;
+        } else {
+            $where['company_id']  = $admin_company_id;
+        }
         // 执行删除
         $result =  $ViolationStoreModel->deleteViolationStore($where);
         // 提示删除失败
@@ -560,9 +640,16 @@ class ViolationStore extends Controller
     {
         // 验证参数
         $request->scene('data_cleaning')->validate();
+        $admin_company_id = request('admin_company_id', '0');
+        $company_id = request('access_token.company_id', '0');
+        $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
         $admin_id   = request('access_token.uid', 0); //用户ID
-        $is_admin   = request('access_token.is_admin'); //是否管理员操作 0=是1=否
-        $message_data = ['page' => '1', 'limit' => 50, 'admin_id' => $admin_id, 'is_admin' => $is_admin];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+        } else {
+            $company_id = $admin_company_id;
+        }
+        $message_data = ['page' => '1', 'limit' => 50, 'admin_id' => $admin_id, 'is_admin' => $is_admin, 'company_id' => $company_id];
         ViolationStoreJobs::dispatch($message_data);
         // ViolationStoreJobs::dispatchSync($message_data);
         // 告知结果

+ 2 - 0
app/Jobs/Manager/Process/LowPriceGoodsDataJobs.php

@@ -76,6 +76,7 @@ class LowPriceGoodsDataJobs implements ShouldQueue
         $specify_responsible_person = $message_data['specify_responsible_person']; //指派责任人 0=开启 1=关闭
         $limit = isset($message_data['limit']) ? $message_data['limit'] : 50;
         $page = isset($message_data['page']) ? $message_data['page'] : 1;
+        $company_id = isset($message_data['company_id']) ? $message_data['company_id'] : 0;
 
         $where = [];
         if ($platform != '0') {
@@ -98,6 +99,7 @@ class LowPriceGoodsDataJobs implements ShouldQueue
         }
         foreach ($product_datas as $product_data) {
             $insert_product_data = [
+                'company_id' => $company_id,
                 'source_id' => $product_data['id'],
                 'platform'    => $product_data['platform_id'],
                 'company_name'    => $product_data['company_name'],

+ 13 - 8
app/Jobs/Manager/Process/LowPriceGoodsJobs.php

@@ -10,7 +10,7 @@ use Illuminate\Queue\InteractsWithQueue;
 use Illuminate\Queue\SerializesModels;
 use App\Facades\Servers\Logs\Log;
 use App\Models\Manager\WashConfig\LowPriceGoods as ConfigLowPriceGoodsModel;
-use App\Models\Api\Process\ExecuteLog as ExecuteLogModel;
+use App\Models\Manager\Process\ExecuteLog as ExecuteLogModel;
 use App\Jobs\Manager\Process\LowPriceGoodsDataJobs;
 use App\Models\Manager\WashConfig\ViolationStore as ViolationStoreModel;
 use App\Models\Manager\WashConfig\LowPriceGoodsCompany as LowPriceGoodsCompanyModel;
@@ -50,16 +50,20 @@ class LowPriceGoodsJobs implements ShouldQueue
             $executeLog_id = isset($this->message_data['executeLog_id']) ? $this->message_data['executeLog_id'] : 0;
             $admin_id = isset($this->message_data['admin_id']) ? $this->message_data['admin_id'] : 0;
             $is_admin = isset($this->message_data['is_admin']) ? $this->message_data['is_admin'] : 0;
+            $company_id = isset($this->message_data['company_id']) ? $this->message_data['company_id'] : 0;
             if ($page == 1) {
                 $ExecuteLogModel = new ExecuteLogModel();
-                $insert_data = ['name' => '低价挂网商品', 'code' => 'LowPriceGoodsJobs', 'admin_id' => $admin_id,'is_admin' => $is_admin];
+                $insert_data = ['company_id' => $company_id, 'name' => '低价挂网商品', 'code' => 'LowPriceGoodsJobs', 'admin_id' => $admin_id, 'is_admin' => $is_admin];
                 $executeLog_id = $ExecuteLogModel->addExecuteLog_content($insert_data);
             }
-            $list_config_data = $ConfigLowPriceGoodsModel->leftjoin('washconfig_product_category', 'washconfig_product_category.id', '=', 'washconfig_lowprice_product.category_id')
-                ->where('washconfig_lowprice_product.status', 0)
-                ->select(['washconfig_lowprice_product.*', 'washconfig_product_category.name as category_name'])
-                ->paginate($limit, ['*'], 'page', $page)->toarray();
-              
+            $ConfigLowPriceGoodsModel = $ConfigLowPriceGoodsModel->leftjoin('washconfig_product_category', 'washconfig_product_category.id', '=', 'washconfig_lowprice_product.category_id')
+                ->where(['washconfig_lowprice_product.status' => 0])
+                ->select(['washconfig_lowprice_product.*', 'washconfig_product_category.name as category_name']);
+            if ($company_id) {
+                $ConfigLowPriceGoodsModel = $ConfigLowPriceGoodsModel->where('washconfig_lowprice_product.company_id', $company_id);
+            }
+            $list_config_data = $ConfigLowPriceGoodsModel->paginate($limit, ['*'], 'page', $page)->toarray();
+
             if (!$list_config_data || empty($list_config_data['data'])) {
                 return true;
             }
@@ -71,6 +75,7 @@ class LowPriceGoodsJobs implements ShouldQueue
                     ->select(['washconfig_violation_store.id', 'washconfig_violation_store.social_credit_code', 'washconfig_lowprice_product_company.company_id'])->get()->toArray();
                 $social_credit_code = !empty($company_data) ? array_column($company_data, 'social_credit_code') : '';
                 $message_data = [
+                    'company_id' => $value['company_id'],
                     'id' => $value['id'],
                     'platform' => $value['platform'],
                     'product_name' => $value['product_name'],
@@ -80,7 +85,7 @@ class LowPriceGoodsJobs implements ShouldQueue
                     'company_scope' => $value['company_scope'],
                     'social_credit_code' => $social_credit_code,
                     'executeLog_id' => $executeLog_id,
-                    'category_name' => $value['category_name'] ? $value['category_name']:'',
+                    'category_name' => $value['category_name'] ? $value['category_name'] : '',
                     'specify_responsible_person' => $value['specify_responsible_person'],
                 ];
                 LowPriceGoodsDataJobs::dispatch($message_data);

+ 2 - 0
app/Jobs/Manager/Process/ViolationProductDataJobs.php

@@ -75,6 +75,7 @@ class ViolationProductDataJobs implements ShouldQueue
         $specify_responsible_person = $message_data['specify_responsible_person']; //指派责任人 0=开启 1=关闭
         $limit = isset($message_data['limit']) ? $message_data['limit'] : 50;
         $page = isset($message_data['page']) ? $message_data['page'] : 1;
+        $company_id = isset($message_data['company_id']) ? $message_data['company_id'] : 0;
 
         $where = [];
         if ($platform != '0') {
@@ -96,6 +97,7 @@ class ViolationProductDataJobs implements ShouldQueue
         }
         foreach ($product_datas as $product_data) {
             $insert_product_data = [
+                'company_id' => $company_id,
                 'source_id' => $product_data['id'],
                 'platform'    => $product_data['platform_id'],
                 'company_name'    => $product_data['company_name'],

+ 10 - 4
app/Jobs/Manager/Process/ViolationProductJobs.php

@@ -10,7 +10,7 @@ use Illuminate\Queue\InteractsWithQueue;
 use Illuminate\Queue\SerializesModels;
 use App\Facades\Servers\Logs\Log;
 use App\Models\Manager\WashConfig\ViolationProduct as ConfigViolationProductModel;
-use App\Models\Api\Process\ExecuteLog as ExecuteLogModel;
+use App\Models\Manager\Process\ExecuteLog as ExecuteLogModel;
 use App\Jobs\Manager\Process\ViolationProductDataJobs;
 use App\Models\Manager\WashConfig\ViolationProductCompany as ViolationProductCompanyModel;
 
@@ -49,14 +49,19 @@ class ViolationProductJobs implements ShouldQueue
             $executeLog_id = isset($this->message_data['executeLog_id']) ? $this->message_data['executeLog_id'] : 0;
             $admin_id = isset($this->message_data['admin_id']) ? $this->message_data['admin_id'] : 0;
             $is_admin = isset($this->message_data['is_admin']) ? $this->message_data['is_admin'] : 0;
+            $company_id = isset($this->message_data['company_id']) ? $this->message_data['company_id'] : 0;
             if($page == 1){
                 $ExecuteLogModel = new ExecuteLogModel();
-                $insert_data =['name' =>'违规挂网商品', 'code' => 'ViolationProductJobs', 'admin_id' => $admin_id,'is_admin' => $is_admin];
+                $insert_data =['company_id'=> $company_id,'name' =>'违规挂网商品', 'code' => 'ViolationProductJobs', 'admin_id' => $admin_id,'is_admin' => $is_admin];
                 $executeLog_id=$ExecuteLogModel->addExecuteLog_content($insert_data);
             }
-            $list_config_data = $ConfigViolationProductModel->leftjoin('washconfig_product_category', 'washconfig_product_category.id', '=', 'washconfig_violation_product.category_id')
+            $ConfigViolationProductModel = $ConfigViolationProductModel->leftjoin('washconfig_product_category', 'washconfig_product_category.id', '=', 'washconfig_violation_product.category_id')
                 ->where('washconfig_violation_product.status', 0)
-                ->select(['washconfig_violation_product.*', 'washconfig_product_category.name as category_name'])->paginate($limit, ['*'], 'page', $page)->toarray();
+                ->select(['washconfig_violation_product.*', 'washconfig_product_category.name as category_name']);
+            if($company_id){
+                $ConfigViolationProductModel = $ConfigViolationProductModel->where('washconfig_violation_product.company_id', $company_id);
+            }
+            $list_config_data = $ConfigViolationProductModel->paginate($limit, ['*'], 'page', $page)->toarray();
             if (!$list_config_data || empty($list_config_data['data'])) {
                 return true;
             }
@@ -68,6 +73,7 @@ class ViolationProductJobs implements ShouldQueue
                     ->select(['washconfig_violation_store.id', 'washconfig_violation_store.social_credit_code', 'washconfig_violation_product_company.company_id'])->get()->toArray();
                 $social_credit_code = !empty($company_data) ? array_column($company_data, 'social_credit_code') : '';
                 $message_data = [
+                    'company_id' => $value['company_id'],
                     'id' => $value['id'],
                     'platform' => $value['platform'],
                     'product_name' => $value['product_name'],

+ 2 - 0
app/Jobs/Manager/Process/ViolationStoreDataJobs.php

@@ -72,6 +72,7 @@ class ViolationStoreDataJobs implements ShouldQueue
         $specify_responsible_person = $message_data['specify_responsible_person']; //指派责任人 0=开启 1=关闭
         $limit = isset($message_data['limit']) ? $message_data['limit'] : 50;
         $page = isset($message_data['page']) ? $message_data['page'] : 1;
+        $company_id = isset($message_data['company_id']) ? $message_data['company_id'] : 0;
 
         if ($platform != '0') {
             $platform = explode(',', $platform);
@@ -89,6 +90,7 @@ class ViolationStoreDataJobs implements ShouldQueue
         }
         foreach ($product_datas as $product_data) {
             $insert_product_data = [
+                'company_id' => $company_id,
                 'source_id' => $product_data['id'],
                 'platform'    => $product_data['platform_id'],
                 'company_name'    => $product_data['company_name'],

+ 10 - 4
app/Jobs/Manager/Process/ViolationStoreJobs.php

@@ -10,7 +10,7 @@ use Illuminate\Queue\InteractsWithQueue;
 use Illuminate\Queue\SerializesModels;
 use App\Facades\Servers\Logs\Log;
 use App\Models\Manager\WashConfig\ViolationStore as ViolationStoreModel;
-use App\Models\Api\Process\ExecuteLog as ExecuteLogModel;
+use App\Models\Manager\Process\ExecuteLog as ExecuteLogModel;
 use App\Jobs\Manager\Process\ViolationStoreDataJobs;
 
 /**
@@ -47,19 +47,25 @@ class ViolationStoreJobs implements ShouldQueue
             $executeLog_id = isset($this->message_data['executeLog_id']) ? $this->message_data['executeLog_id'] : 0;
             $admin_id = isset($this->message_data['admin_id']) ? $this->message_data['admin_id'] : 0;
             $is_admin = isset($this->message_data['is_admin']) ? $this->message_data['is_admin'] : 0;
+            $company_id = isset($this->message_data['company_id']) ? $this->message_data['company_id'] : 0;
             if($page == 1){
                 $ExecuteLogModel = new ExecuteLogModel();
-                $insert_data =['name' =>'违规挂网店铺', 'code' => 'ViolationStoreJobs', 'admin_id' => $admin_id,'is_admin' => $is_admin];
+                $insert_data =['company_id'=>$company_id,'name' =>'违规挂网店铺', 'code' => 'ViolationStoreJobs', 'admin_id' => $admin_id,'is_admin' => $is_admin];
                 $executeLog_id=$ExecuteLogModel->addExecuteLog_content($insert_data);
             }
-            $list_config_data = $ViolationStoreModel->leftjoin('washconfig_company_category', 'washconfig_company_category.id', '=', 'washconfig_violation_store.category_id')
-                ->where('washconfig_violation_store.status', 0)->where('store_type', 1)->select(['washconfig_violation_store.*','washconfig_company_category.name as category_name'])->paginate($limit, ['*'], 'page', $page)->toarray();
+            $ViolationStoreModel = $ViolationStoreModel->leftjoin('washconfig_company_category', 'washconfig_company_category.id', '=', 'washconfig_violation_store.category_id')
+                ->where('washconfig_violation_store.status', 0)->where('store_type', 1)->select(['washconfig_violation_store.*','washconfig_company_category.name as category_name']);
+            if($company_id){
+                $ViolationStoreModel = $ViolationStoreModel->where('washconfig_violation_store.company_id', $company_id);
+            }
+            $list_config_data = $ViolationStoreModel->paginate($limit, ['*'], 'page', $page)->toarray();
             if (!$list_config_data || empty($list_config_data['data'])) {
                 return true;
             }
             $list_data = $list_config_data['data'];
             foreach ($list_data as $key => $value) {
                 $message_data = [
+                    'company_id' => $value['company_id'],
                     'id' => $value['id'],
                     'platform' => $value['platform'],
                     'store_name'=> $value['store_name'],

+ 157 - 0
app/Models/Manager/Process/ExecuteLog.php

@@ -0,0 +1,157 @@
+<?php
+
+namespace App\Models\Manager\Process;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 违规处理-执行日志模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-09
+ */
+class ExecuteLog extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'process_execute_log';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-09
+     */
+    public function addExecuteLog_content($data)
+    {
+        $insert_data = [
+            'company_id' => $data['company_id'],
+            'name' => $data['name'],
+            'code' => $data['code'],
+            'admin_id'    => $data['admin_id'],
+            'insert_time' => time(),
+        ];
+        $ExecuteLog_id = $this->insertGetId($insert_data);
+        return $ExecuteLog_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-09
+     * @param $data
+     * @return bool
+     */
+    public function addExecuteLog($data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->addExecuteLog_content($data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-09
+     * @param $data
+     * @return bool
+     */
+    public function editExecuteLog_content($where, $data)
+    {
+        $ExecuteLog = $this->where($where)->first();
+        if (!$ExecuteLog) {
+            return false;
+        }
+        $ExecuteLog->company_id = $data['company_id'];
+        $ExecuteLog->name = $data['name'];
+        $ExecuteLog->code = $data['responsible_person'];
+        $ExecuteLog->admin_id = $data['product_name'];
+        $ExecuteLog->update_time = time();
+        $ExecuteLog->save();
+        return true;
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-09
+     * @param $data
+     * @return bool
+     */
+    public function updateExecuteLog($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->editExecuteLog_content($where, $data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-09
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $ExecuteLog = $this->where($where)->first();
+        if (!$ExecuteLog) {
+            return false;
+        }
+        $ExecuteLog->status = $status;
+        $ExecuteLog->update_time = time();
+        $ExecuteLog->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-09
+     * @param $id
+     * @return bool
+     */
+    public function deleteExecuteLog($where)
+    {
+        $ExecuteLog = $this->where($where)->first();
+        if (!$ExecuteLog) {
+            return false;
+        }
+        $ExecuteLog->delete();
+        return true;
+    }
+}

+ 4 - 0
app/Models/Manager/Process/LowPriceGoods.php

@@ -57,6 +57,7 @@ class LowPriceGoods extends Model
     public function addLowPriceGoods_content($data)
     {
         $insert_data = [
+            'company_id' => $data['company_id'],
             'first_responsible_person' => $data['first_responsible_person'],
             'responsible_person' => $data['responsible_person'],
             'platform'    => $data['platform'],
@@ -88,6 +89,7 @@ class LowPriceGoods extends Model
     public function addLowPriceGoods($data,$is_import = false)
     {
         if ($is_import == false) {
+            $source_where[] = ['company_id', '=', $data['company_id']];
             $source_where[] = ['source_id', '=', $data['source_id']];
             $source_where[] = ['product_name', '=', $data['product_name']];
             $source_where[] = ['product_specs', '=', $data['product_specs']];
@@ -101,6 +103,7 @@ class LowPriceGoods extends Model
         try {
             $LowPriceGoodsMemberModel = new LowPriceGoodsMemberModel();
             $insert_data = [
+                'company_id' => $data['company_id'],
                 'source_id' => $data['source_id'],
                 'first_responsible_person' => $data['first_responsible_person'] ? ','.$data['first_responsible_person'].',':'',
                 'responsible_person' => $data['responsible_person'] ? ','.$data['responsible_person'].',':'',
@@ -189,6 +192,7 @@ class LowPriceGoods extends Model
         if (!$LowPriceGoods) {
             return false;
         }
+        $LowPriceGoods->company_id = $data['company_id'];
         $LowPriceGoods->first_responsible_person = $data['first_responsible_person'];
         $LowPriceGoods->responsible_person = $data['responsible_person'];
         $LowPriceGoods->platform = $data['platform'];

+ 15 - 10
app/Models/Manager/Process/ViolationProduct.php

@@ -55,6 +55,8 @@ class ViolationProduct extends Model
     public function addViolationProduct_content($data)
     {
         $insert_data = [
+            'company_id' => $data['company_id'],
+            'source_id' => $data['source_id'],
             'first_responsible_person' => $data['first_responsible_person'],
             'responsible_person' => $data['responsible_person'],
             'platform'    => $data['platform'],
@@ -81,10 +83,11 @@ class ViolationProduct extends Model
      * @param $data
      * @return bool
      */
-    public function addViolationProduct($data,$is_import = false)
+    public function addViolationProduct($data, $is_import = false)
     {
-        if($is_import == false){
-             $source_where[] = ['source_id', '=', $data['source_id']];
+        if ($is_import == false) {
+            $source_where[] = ['company_id', '=', $data['company_id']];
+            $source_where[] = ['source_id', '=', $data['source_id']];
             $source_where[] = ['product_name', '=', $data['product_name']];
             $source_where[] = ['product_specs', '=', $data['product_specs']];
             $source_id_log = $this->where($source_where)->count();
@@ -96,9 +99,10 @@ class ViolationProduct extends Model
         try {
             $ViolationProductMemberModel = new ViolationProductMemberModel();
             $insert_data = [
+                'company_id' => $data['company_id'],
                 'source_id' => $data['source_id'],
-                'first_responsible_person' => $data['first_responsible_person'] ? ','.$data['first_responsible_person'].',':'',
-                'responsible_person' => $data['responsible_person'] ? ','.$data['responsible_person'].',':'',
+                'first_responsible_person' => $data['first_responsible_person'] ? ',' . $data['first_responsible_person'] . ',' : '',
+                'responsible_person' => $data['responsible_person'] ? ',' . $data['responsible_person'] . ',' : '',
                 'platform'    => $data['platform'],
                 'company_name'    => $data['company_name'],
                 'product_name'    => $data['product_name'],
@@ -112,14 +116,14 @@ class ViolationProduct extends Model
                 'area_info' => $data['area_info'],
                 'link_url'    => $data['link_url'],
                 'store_name'    => $data['store_name'],
-                'source_responsible_person'    => $data['source_responsible_person'] ? ','.$data['source_responsible_person'].',':'',
+                'source_responsible_person'    => $data['source_responsible_person'] ? ',' . $data['source_responsible_person'] . ',' : '',
                 'category_name' => $data['category_name'],
                 'company_category_name' => $data['company_category_name'],
                 'processing_status' => '1',
                 'insert_time' => time(),
             ];
             $ViolationProduct_id = $this->insertGetId($insert_data);
-            $first_responsible_persons = $data['first_responsible_person'] !=''? explode(',', $data['first_responsible_person']):[];
+            $first_responsible_persons = $data['first_responsible_person'] != '' ? explode(',', $data['first_responsible_person']) : [];
             $first_responsible_person_data = [];
             if (count($first_responsible_persons) > 0) {
                 foreach ($first_responsible_persons as $key => $employee_id) {
@@ -131,7 +135,7 @@ class ViolationProduct extends Model
                 }
             }
             $ViolationProductMemberModel->insert($first_responsible_person_data);
-            $responsible_persons = $data['responsible_person'] !='' ? explode(',', $data['responsible_person']):[];
+            $responsible_persons = $data['responsible_person'] != '' ? explode(',', $data['responsible_person']) : [];
             $responsible_person_data = [];
             if (count($responsible_persons) > 0) {
                 foreach ($responsible_persons as $key => $employee_id) {
@@ -143,7 +147,7 @@ class ViolationProduct extends Model
                 }
             }
             $ViolationProductMemberModel->insert($responsible_person_data);
-            $source_responsible_persons = $data['source_responsible_person'] !='' ? explode(',', $data['source_responsible_person']):[];
+            $source_responsible_persons = $data['source_responsible_person'] != '' ? explode(',', $data['source_responsible_person']) : [];
             $source_responsible_person_data = [];
             if (count($source_responsible_persons) > 0) {
                 foreach ($source_responsible_persons as $key => $employee_id) {
@@ -161,7 +165,7 @@ class ViolationProduct extends Model
         } catch (\Exception $e) {
             DB::rollBack();
             // 错误处理...
-            Log::info('job_error', '数据清洗-新增违规商品处理记录失败', ['data'=>$data,'error' => $e->getMessage()]);
+            Log::info('job_error', '数据清洗-新增违规商品处理记录失败', ['data' => $data, 'error' => $e->getMessage()]);
             return false;
         }
     }
@@ -181,6 +185,7 @@ class ViolationProduct extends Model
         if (!$ViolationProduct) {
             return false;
         }
+        $ViolationProduct->company_id = $data['company_id'];
         $ViolationProduct->first_responsible_person = $data['first_responsible_person'];
         $ViolationProduct->responsible_person = $data['responsible_person'];
         $ViolationProduct->platform = $data['platform'];

+ 3 - 0
app/Models/Manager/Process/ViolationStore.php

@@ -69,6 +69,7 @@ class ViolationStore extends Model
      */
     public function addViolationStore($data)
     {
+        $source_where[] = ['company_id', '=', $data['company_id']];
         $source_where[] = ['store_name', '=', $data['store_name']];
         $source_where[] = ['social_credit_code', '=', $data['social_credit_code']];
         $source_id_log = $this->where($source_where)->count();
@@ -79,6 +80,7 @@ class ViolationStore extends Model
         try {
             $ViolationStoreMemberModel = new ViolationStoreMemberModel();
             $insert_data = [
+                'company_id' => $data['company_id'],
                 'source_id' => $data['source_id'],
                 'first_responsible_person' => $data['first_responsible_person'] ? ',' . $data['first_responsible_person'] . ',' : '',
                 'responsible_person' => $data['responsible_person'] ? ',' . $data['responsible_person'] . ',' : '',
@@ -160,6 +162,7 @@ class ViolationStore extends Model
         if (!$ViolationStore) {
             return false;
         }
+        $ViolationStore->company_id = $data['company_id'];
         $ViolationStore->first_responsible_person = $data['first_responsible_person'];
         $ViolationStore->responsible_person = $data['responsible_person'];
         $ViolationStore->platform = $data['platform'];