Răsfoiți Sursa

Merge branch 'version_0302'

tangyuanwang 1 săptămână în urmă
părinte
comite
127bf7b7df
34 a modificat fișierele cu 1545 adăugiri și 372 ștergeri
  1. 8 8
      app/Http/Controllers/Api/Login.php
  2. 48 0
      app/Http/Controllers/Api/Personnel/Employee.php
  3. 48 0
      app/Http/Controllers/Api/Personnel/Subscribe.php
  4. 30 21
      app/Http/Controllers/Api/Process/LowPriceGoods.php
  5. 11 3
      app/Http/Controllers/Api/Process/ViolationProduct.php
  6. 10 4
      app/Http/Controllers/Api/Process/ViolationStore.php
  7. 4 0
      app/Http/Controllers/Api/WashConfig/ControlGoods.php
  8. 4 0
      app/Http/Controllers/Api/WashConfig/LowPriceGoods.php
  9. 4 0
      app/Http/Controllers/Api/WashConfig/ViolationProduct.php
  10. 2 0
      app/Http/Controllers/Api/WashConfig/ViolationStore.php
  11. 3 3
      app/Http/Controllers/Manager/Login.php
  12. 52 0
      app/Http/Controllers/Manager/Personnel/Employee.php
  13. 2 1
      app/Http/Middleware/Manager/AccessAuth.php
  14. 1 0
      app/Http/Requests/Api/Personnel/Employee.php
  15. 64 0
      app/Http/Requests/Api/Personnel/Subscribe.php
  16. 1 0
      app/Http/Requests/Manager/Personnel/Employee.php
  17. 1 0
      app/Jobs/Manager/Process/LowPriceGoodsDataJobs.php
  18. 199 0
      app/Jobs/Manager/Process/Subscription.php
  19. 1 0
      app/Jobs/Manager/Process/ViolationProductDataJobs.php
  20. 1 0
      app/Jobs/Manager/Process/ViolationStoreDataJobs.php
  21. 246 0
      app/Models/Api/Citys.php
  22. 148 0
      app/Models/Api/Personnel/Department.php
  23. 2 2
      app/Models/Api/Personnel/Employee.php
  24. 153 0
      app/Models/Api/Personnel/Roles.php
  25. 2 0
      app/Models/Manager/Process/LowPriceGoods.php
  26. 2 0
      app/Models/Manager/Process/ViolationProduct.php
  27. 2 0
      app/Models/Manager/Process/ViolationStore.php
  28. 98 0
      app/Servers/Wechat/Official.php
  29. 2 2
      app/Servers/Wechat/WeChatWebApp.php
  30. 6 2
      composer.json
  31. 370 319
      composer.lock
  32. 11 6
      config/wechat.php
  33. 6 1
      routes/api.php
  34. 3 0
      routes/manager.php

+ 8 - 8
app/Http/Controllers/Api/Login.php

@@ -35,7 +35,7 @@ class Login extends Api
 		// 接收数据
 		$password    = $Request->input('password', '');
 		// 查询用户
-		$admin        = $EmployeeModel->Where('employee_code', $employee_code)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
+		$admin        = $EmployeeModel->Where('employee_code', $employee_code)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
 		// 用户不存在
 		if (!$admin || $admin['status'])    return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 用户不存在
@@ -45,7 +45,7 @@ class Login extends Api
 		// 比对密码
 		if (md5($password) != $admin['password']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 登录
-		$accessToken                         = $EmployeeModel->Login($admin['id'], 'api');
+		$accessToken                         = $EmployeeModel->Login($admin['id'],$admin['company_id'], 'api');
 		// 比对密码
 		if (isset($accessToken['error']))     return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
 		// 获取权限列表
@@ -94,7 +94,7 @@ class Login extends Api
 		// 接收数据
 		$password    = $Request->input('password', '');
 		// 查询用户
-		$user_info        = $EmployeeModel->where('mobile', $phone)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
+		$user_info        = $EmployeeModel->where('mobile', $phone)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
 		// 用户不存在
 		if (!$user_info || $user_info['status'])    return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 用户不存在
@@ -104,7 +104,7 @@ class Login extends Api
 		// 比对密码
 		if (md5($password) != $user_info['password']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 登录
-		$accessToken                         = $EmployeeModel->Login($user_info['id'], 'api');
+		$accessToken                         = $EmployeeModel->Login($user_info['id'],$user_info['company_id'], 'api');
 		// 比对密码
 		if (isset($accessToken['error']))     return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
 		// 获取权限列表
@@ -163,7 +163,7 @@ class Login extends Api
 		// 接收数据
 		$password    = $Request->input('password', '');
 		// 查询用户
-		$admin    	= $EmployeeModel->where('email', $email)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
+		$admin    	= $EmployeeModel->where('email', $email)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
 		// 用户不存在
 		if (!$admin)	return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 用户不存在
@@ -173,7 +173,7 @@ class Login extends Api
 		// 比对密码
 		if (md5($password) != $admin['password']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 登录
-		$accessToken 						= $EmployeeModel->Login($admin['id'], 'api');
+		$accessToken 						= $EmployeeModel->Login($admin['id'],$admin['company_id'], 'api');
 		// 比对密码
 		if (isset($accessToken['error'])) 	return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
 		// 获取权限列表
@@ -205,7 +205,7 @@ class Login extends Api
 		if (!$session)                     return json_send(['code' => 'error', 'msg' => '请先获取手机号验证码']);
 		if ($session['code'] != $code || $session['mobile'] != $phone) return json_send(['code' => 'error', 'msg' => '验证码错误']);
 		// 查询用户
-		$admin    	= $EmployeeModel->where('mobile', $phone)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
+		$admin    	= $EmployeeModel->where('mobile', $phone)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
 		// 用户不存在
 		if (!$admin)	return json_send(['code' => 'error', 'msg' => '账号不存在']);
 		// 用户不存在
@@ -213,7 +213,7 @@ class Login extends Api
 		// 转数组
 		$admin    	= $admin->toArray();
 		// 登录
-		$accessToken 						= $EmployeeModel->Login($admin['id'], 'api');
+		$accessToken 						= $EmployeeModel->Login($admin['id'],$admin['company_id'], 'api');
 		// 比对密码
 		if (isset($accessToken['error'])) 	return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
 		// 获取权限列表

+ 48 - 0
app/Http/Controllers/Api/Personnel/Employee.php

@@ -5,6 +5,9 @@ namespace App\Http\Controllers\Api\Personnel;
 use App\Http\Controllers\Api\Api;
 use App\Http\Requests\Api\Personnel\Employee as Request;
 use App\Models\Api\Personnel\Employee as EmployeeModel;
+use App\Models\Api\Personnel\Department as DepartmentModel;
+use App\Models\Api\Personnel\Roles as RolesModel;
+use App\Models\Api\Citys as CitysModel;
 
 /**
  * 人员信息管理-员工管理
@@ -26,8 +29,10 @@ class Employee extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[]=['company_id','=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $name = request('name', '');
         // 其他条件
@@ -45,4 +50,47 @@ class Employee extends Api
         // 加载模板
         return        json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
     }
+
+
+
+    /**
+     * 个人信息详情
+     * @author    唐远望
+     * @version   1.0
+     * @date      2026-03-03
+     */
+    public function personal_info(Request $request, EmployeeModel $EmployeeModel, DepartmentModel $DepartmentModel, RolesModel $RolesModel, CitysModel $CitysModel)
+    {
+        $request->scene('personal_info')->validate();
+        $user_info = $this->checkLogin();
+        if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $company_id = $user_info['company_id'];
+        // 接收参数
+        $map = ['id' => $user_info['uid']];
+        // 权限判断
+        $map['company_id'] = $company_id;
+        $field = ['id', 'employee_code', 'name', 'mobile', 'email', 'department_ids', 'duty_type', 'role_id', 'city_ids', 'open_notice', 'insert_time', 'update_time', 'status'];
+        $data = $EmployeeModel->where($map)->select($field)->first();
+        if (!$data)     return json_send(['code' => 'error', 'msg' => '记录不存在']);
+        // 查询部门信息
+        $department_ids = explode(',', $data['department_ids']);
+        $department_info = $DepartmentModel->whereIn('id', $department_ids)->select(['id', 'name'])->get()->toarray();
+        // 查询角色信息
+        $role_where = ['id' => $data['role_id']];
+        $role_where['company_id'] = $company_id;
+        $role_info = $RolesModel->where($role_where)->first();
+        // 查询城市信息
+        $city_ids = explode(',', $data['city_ids']);
+        $city_info = [];
+        if (count($city_ids) > 0) {
+            $city_info = $CitysModel->whereIn('id', $city_ids)->pluck('name');
+        }
+        //截取字符串
+        $data['department_ids'] = $data['department_ids'] != '' ? substr($data['department_ids'], 1, strlen($data['department_ids']) - 2) : '';
+        $data['department_name'] = isset($department_info) ? array_column($department_info, 'name') : '';
+        $data['role_name'] = isset($role_info['name']) ? $role_info['name'] : '';
+        $data['city_info'] = $city_info;
+        // 加载模板
+        return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $data]);
+    }
 }

+ 48 - 0
app/Http/Controllers/Api/Personnel/Subscribe.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace App\Http\Controllers\Api\Personnel;
+
+use App\Http\Controllers\Api\Api;
+use App\Http\Requests\Api\Personnel\Subscribe as Request;
+use App\Models\Api\Personnel\Employee as EmployeeModel;
+
+/**
+ * 员工订阅管理
+ * @author 唐远望
+ * @version 1.0
+ * @date 2026-03-03
+ */
+class Subscribe extends Api
+{
+    /**
+     * 订阅开关
+     * @author    唐远望
+     * @version   1.0
+     * @date      2026-03-03
+     * 
+     */
+    public function change_subscribe(Request $request, EmployeeModel $EmployeeModel)
+    {
+
+        $request->scene('change_subscribe')->validate();
+        $user_info = $this->checkLogin();
+        if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $company_id = $user_info['company_id'];
+        $uid = $user_info['uid'];
+        $open_subscribe = request('open_subscribe', 0); //订阅状态0=开启1=关闭 (默认开启)
+        // 查询条件
+        $map  = [];
+        // 其他条件
+        $map[] = ['id', '=', $uid];
+        $map[] = ['company_id', '=', $company_id];
+        // 查询数据
+        $result_model = $EmployeeModel->query();
+        $user_info = $result_model->where($map)->first();
+        // 分配数据
+        if (!$user_info)  return json_send(['code' => 'error', 'msg' => '个人信息获取错误']);
+        $user_info->open_subscribe = $open_subscribe;
+        $user_info->save();
+        // 加载模板
+        return        json_send(['code' => 'success', 'msg' => '操作成功', 'data' => '']);
+    }
+}

+ 30 - 21
app/Http/Controllers/Api/Process/LowPriceGoods.php

@@ -24,14 +24,16 @@ class LowPriceGoods extends Api
      * @date      2025-12-09
      * 
      */
-    public function list(Request $request, LowPriceGoodsModel $LowPriceGoodsModel, EmployeeModel $EmployeeModel,LowPriceGoodsMemberModel $LowPriceGoodsMemberModel)
+    public function list(Request $request, LowPriceGoodsModel $LowPriceGoodsModel, EmployeeModel $EmployeeModel, LowPriceGoodsMemberModel $LowPriceGoodsMemberModel)
     {
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $user_id = $user_info['uid'];
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '');
         $start_time = request('start_time', '');
@@ -53,47 +55,48 @@ class LowPriceGoods extends Api
         if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
-        if ($store_name) $map[]   = ['store_name','like',"%$store_name%"];
+        if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+
 
         //多选平台查询
-        if($platform && is_string($platform)){
+        if ($platform && is_string($platform)) {
             $platform = explode(',', $platform);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('platform', $platform);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('platform', $platform);
         }
         //多选处理状态查询
-        if($processing_status && is_string($processing_status)){
+        if ($processing_status && is_string($processing_status)) {
             $processing_status = explode(',', $processing_status);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('processing_status', $processing_status);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('processing_status', $processing_status);
         }
         //多选状态查询
-        if($status && is_string($status)){
+        if ($status && is_string($status)) {
             $status = explode(',', $status);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('status', $status);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('status', $status);
         }
         //多选店铺名称查询
-        if($store_names && is_string($store_names)){
+        if ($store_names && is_string($store_names)) {
             $store_names = explode(',', $store_names);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('store_name', $store_names);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('store_name', $store_names);
         }
         //多选违规挂网次数查询
-        if($online_posting_count && is_string($online_posting_count)){
+        if ($online_posting_count && is_string($online_posting_count)) {
             $online_posting_count = explode(',', $online_posting_count);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('online_posting_count', $online_posting_count);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('online_posting_count', $online_posting_count);
         }
         //多选规格查询
-        if($product_specs && is_string($product_specs)){
+        if ($product_specs && is_string($product_specs)) {
             $product_specs = explode(',', $product_specs);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('product_specs', $product_specs);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('product_specs', $product_specs);
         }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('product_name', $product_names);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('product_name', $product_names);
         }
         //多选公司查询
         if ($company_name && is_string($company_name)) {
             $company_name = explode(',', $company_name);
-            $LowPriceGoodsModel=$LowPriceGoodsModel->whereIn('company_name', $company_name);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('company_name', $company_name);
         }
         //多选第一责任人
         if ($first_responsible_person && is_string($first_responsible_person)) {
@@ -123,12 +126,12 @@ class LowPriceGoods extends Api
         // 查询数据
         $result = $LowPriceGoodsModel->where($map)->where(function ($q) use ($user_id) {
             $q->where('first_responsible_person', 'like', "%,$user_id,%")
-            ->orWhere('responsible_person', 'like', "%,$user_id,%")
-            ->orWhere('source_responsible_person', 'like', "%,$user_id,%");
+                ->orWhere('responsible_person', 'like', "%,$user_id,%")
+                ->orWhere('source_responsible_person', 'like', "%,$user_id,%");
         })
-        ->orderByDesc('id')
-        ->paginate($limit)
-        ->toArray();
+            ->orderByDesc('id')
+            ->paginate($limit)
+            ->toArray();
         // 分配数据
         if (!$result)  return json_send(['code' => 'error', 'msg' => '暂无数据']);
         if (isset($result['data']) && count($result['data']) > 0) {
@@ -162,9 +165,11 @@ class LowPriceGoods extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('detail')->validate();
+        $company_id = $user_info['company_id'];
         // 接收参数
         $id = request('id', 0);
         $map = ['id' => $id];
+        $map['company_id'] = $company_id;
         $data = $LowPriceGoodsModel->where($map)->first();
         if (!$data)     return json_send(['code' => 'error', 'msg' => '记录不存在']);
         //查询第一责任人名称
@@ -194,6 +199,7 @@ class LowPriceGoods extends Api
     {
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $company_id = $user_info['company_id'];
         // 验证参数
         $request->scene('set_status')->validate();
         // 接收数据
@@ -201,6 +207,7 @@ class LowPriceGoods extends Api
         $status            = request('status', 0);
         // 查询用户
         $where = ['id' => $id];
+        $where['company_id'] = $company_id;
         // 执行修改
         $result            =  $LowPriceGoodsModel->changeStatus($where, $status);
         // 提示新增失败
@@ -220,6 +227,7 @@ class LowPriceGoods extends Api
     {
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $company_id = $user_info['company_id'];
         // 验证参数
         $request->scene('set_processing_status')->validate();
         // 接收数据
@@ -227,6 +235,7 @@ class LowPriceGoods extends Api
         $processing_status = request('processing_status', 0);
         // 查询用户
         $where = ['id' => $id];
+        $where['company_id'] = $company_id;
         // 执行修改
         $result            =  $LowPriceGoodsModel->changeProcessingStatus($where, $processing_status);
         // 提示新增失败

+ 11 - 3
app/Http/Controllers/Api/Process/ViolationProduct.php

@@ -30,8 +30,10 @@ class ViolationProduct extends Api
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $user_id = $user_info['uid'];
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '');
         $start_time = request('start_time', '');
@@ -55,6 +57,7 @@ class ViolationProduct extends Api
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name','like',"%$store_name%"];
 
+
         //多选平台查询
         if($platform && is_string($platform)){
             $platform = explode(',', $platform);
@@ -161,9 +164,10 @@ class ViolationProduct extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('detail')->validate();
+        $company_id = $user_info['company_id'];
         // 接收参数
         $id = request('id', 0);
-        $map = ['id' => $id];
+        $map = ['id' => $id, 'company_id' => $company_id];
         $data = $ViolationProductModel->where($map)->first();
         if (!$data)     return json_send(['code' => 'error', 'msg' => '记录不存在']);
                 //查询第一责任人名称
@@ -192,13 +196,15 @@ class ViolationProduct extends Api
      */
     public function set_status(Request $request, ViolationProductModel $ViolationProductModel)
     {
+        $user_info = $this->checkLogin();
         // 验证参数
         $request->scene('set_status')->validate();
+        $company_id = $user_info['company_id'];
         // 接收数据
         $id                = request('id', 0);
         $status            = request('status', 0);
         // 查询用户
-        $where = ['id' => $id];
+        $where = ['id' => $id, 'company_id' => $company_id];
         // 执行修改
         $result            =  $ViolationProductModel->changeStatus($where, $status);
         // 提示新增失败
@@ -216,13 +222,15 @@ class ViolationProduct extends Api
      */
     public function set_processing_status(Request $request, ViolationProductModel $ViolationProductModel)
     {
+        $user_info = $this->checkLogin();
         // 验证参数
         $request->scene('set_processing_status')->validate();
+        $company_id = $user_info['company_id'];
         // 接收数据
         $id                = request('id', 0);
         $processing_status = request('processing_status', 0);
         // 查询用户
-        $where = ['id' => $id];
+        $where = ['id' => $id, 'company_id' => $company_id];
         // 执行修改
         $result            =  $ViolationProductModel->changeProcessingStatus($where, $processing_status);
         // 提示新增失败

+ 10 - 4
app/Http/Controllers/Api/Process/ViolationStore.php

@@ -29,9 +29,10 @@ class ViolationStore extends Api
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $user_id = $user_info['uid'];
         $request->scene('list')->validate();
-        // 查询条件
+        $company_id = $user_info['company_id'];
        // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '');
         $start_time = request('start_time', '');
@@ -153,9 +154,10 @@ class ViolationStore extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('detail')->validate();
+        $company_id = $user_info['company_id'];
         // 接收参数
         $id = request('id', 0);
-        $map = ['id' => $id];
+        $map = ['id' => $id,'company_id' => $company_id];
         $data = $ViolationStoreModel->where($map)->first();
         if (!$data)     return json_send(['code' => 'error', 'msg' => '记录不存在']);
         //查询第一责任人名称
@@ -184,13 +186,15 @@ class ViolationStore extends Api
      */
     public function set_status(Request $request, ViolationStoreModel $ViolationStoreModel)
     {
+        $user_info = $this->checkLogin();
         // 验证参数
         $request->scene('set_status')->validate();
+        $company_id = $user_info['company_id'];
         // 接收数据
         $id                = request('id', 0);
         $status            = request('status', 0);
         // 查询用户
-        $where = ['id' => $id];
+        $where = ['id' => $id,'company_id' => $company_id];
         // 执行修改
         $result            =  $ViolationStoreModel->changeStatus($where, $status);
         // 提示新增失败
@@ -208,13 +212,15 @@ class ViolationStore extends Api
      */
     public function set_processing_status(Request $request, ViolationStoreModel $ViolationStoreModel)
     {
+        $user_info = $this->checkLogin();
         // 验证参数
         $request->scene('set_processing_status')->validate();
+        $company_id = $user_info['company_id'];
         // 接收数据
         $id                = request('id', 0);
         $processing_status = request('processing_status', 0);
         // 查询用户
-        $where = ['id' => $id];
+        $where = ['id' => $id,'company_id' => $company_id];
         // 执行修改
         $result            =  $ViolationStoreModel->changeProcessingStatus($where, $processing_status);
         // 提示新增失败

+ 4 - 0
app/Http/Controllers/Api/WashConfig/ControlGoods.php

@@ -26,8 +26,10 @@ class ControlGoods extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');
@@ -70,8 +72,10 @@ class ControlGoods extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('spec_list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');

+ 4 - 0
app/Http/Controllers/Api/WashConfig/LowPriceGoods.php

@@ -28,8 +28,10 @@ class LowPriceGoods extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');
@@ -75,8 +77,10 @@ class LowPriceGoods extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('spec_list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');

+ 4 - 0
app/Http/Controllers/Api/WashConfig/ViolationProduct.php

@@ -27,8 +27,10 @@ class ViolationProduct extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');
@@ -71,8 +73,10 @@ class ViolationProduct extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('spec_list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');

+ 2 - 0
app/Http/Controllers/Api/WashConfig/ViolationStore.php

@@ -27,8 +27,10 @@ class ViolationStore extends Api
         $user_info = $this->checkLogin();
         if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
         $request->scene('list')->validate();
+        $company_id = $user_info['company_id'];
         // 查询条件
         $map  = [];
+        $map[] = ['company_id', '=', $company_id];
         $limit = request('limit', config('page_num', 10));
         $status    = request('status', '0');
         $start_time = request('start_time', '');

+ 3 - 3
app/Http/Controllers/Manager/Login.php

@@ -60,7 +60,7 @@ class Login extends Manager
 			$accessToken['is_system_admin']			= 1;
 			// 获取权限列表
 		} else {
-			$admin    	= $EmployeeModel->where('employee_code', $username)->first(['company_id','company_id','id as uid', 'name as username', 'mobile as phone', 'status', 'password', 'insert_time', 'update_time']);
+			$admin    	= $EmployeeModel->where('employee_code', $username)->first(['company_id','id as uid', 'name as username', 'mobile as phone', 'status', 'password', 'insert_time', 'update_time']);
 			// 用户不存在
 			if (!$admin)	return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 			// 用户不存在
@@ -222,7 +222,7 @@ class Login extends Manager
 		// 接收数据
 		$password    = $Request->input('password', '');
 		// 查询用户
-		$admin    	= $EmployeeModel->where('email', $email)->first(['company_id','company_id','id as uid', 'name as username', 'mobile as phone', 'status', 'password', 'insert_time', 'update_time']);
+		$admin    	= $EmployeeModel->where('email', $email)->first(['company_id','id as uid', 'name as username', 'mobile as phone', 'status', 'password', 'insert_time', 'update_time']);
 		// 用户不存在
 		if (!$admin)	return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
 		// 用户不存在
@@ -303,7 +303,7 @@ class Login extends Manager
 		$user_open_data = $EmployeeOpenidModel->where(['openid' => $tokenData['openid']])->first();
 		if (!$user_open_data)   return json_send(['code' => 'error', 'msg' => '未绑定账号,请登录后在绑定']);
 		// 查询用户
-		$admin    	= $EmployeeModel->where('id', $user_open_data->employee_id)->first(['company_id','company_id','id as uid', 'name as username', 'mobile as phone', 'status', 'password', 'insert_time', 'update_time']);
+		$admin    	= $EmployeeModel->where('id', $user_open_data->employee_id)->first(['company_id','id as uid', 'name as username', 'mobile as phone', 'status', 'password', 'insert_time', 'update_time']);
 		// 用户不存在
 		if (!$admin)	return json_send(['code' => 'error', 'msg' => '账号不存在']);
 		// 用户不存在

+ 52 - 0
app/Http/Controllers/Manager/Personnel/Employee.php

@@ -505,4 +505,56 @@ class Employee extends Controller
         // 告知结果
         return             json_send(['code' => 'success', 'msg' => '删除成功']);
     }
+
+
+    /**
+     * 个人信息详情
+     * @author    唐远望
+     * @version   1.0
+     * @date      2026-03-02
+     */
+    public function personal_info(Request $request, EmployeeModel $EmployeeModel, DepartmentModel $DepartmentModel, RolesModel $RolesModel, CitysModel $CitysModel)
+    {
+        $request->scene('personal_info')->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('access_token.uid', 0);
+        $map = ['id' => $id];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $map['company_id'] = $company_id;
+        } else {
+            return json_send(['code' => 'error', 'msg' => '获取失败', 'data' =>'']);
+        }
+        $field = ['id', 'employee_code', 'name', 'mobile', 'email', 'department_ids', 'duty_type', 'role_id', 'city_ids', 'open_notice', 'insert_time', 'update_time', 'status'];
+        $data = $EmployeeModel->where($map)->select($field)->first();
+        if (!$data)     return json_send(['code' => 'error', 'msg' => '记录不存在']);
+        // 查询部门信息
+        $department_ids = explode(',', $data['department_ids']);
+        $department_info = $DepartmentModel->whereIn('id', $department_ids)->select(['id', 'name'])->get()->toarray();
+        // 查询角色信息
+        $role_where = ['id' => $data['role_id']];
+        // 权限判断
+        if ($is_admin != 1 && $company_id != 0) {
+            $role_where['company_id'] = $company_id;
+        } else {
+            return json_send(['code' => 'error', 'msg' => '获取失败', 'data' =>'']);
+        }
+        $role_info = $RolesModel->where($role_where)->first();
+        // 查询城市信息
+        $city_ids = explode(',', $data['city_ids']);
+        $city_info = [];
+        if (count($city_ids) > 0) {
+            $city_info = $CitysModel->whereIn('id', $city_ids)->pluck('name');
+        }
+        //截取字符串
+        $data['department_ids'] = $data['department_ids'] != '' ? substr($data['department_ids'], 1, strlen($data['department_ids']) - 2) : '';
+        $data['department_name'] = isset($department_info) ? array_column($department_info, 'name') : '';
+        $data['role_name'] = isset($role_info['name']) ? $role_info['name'] : '';
+        $data['city_info'] = $city_info;
+        // 加载模板
+        return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $data]);
+    }
 }

+ 2 - 1
app/Http/Middleware/Manager/AccessAuth.php

@@ -21,7 +21,8 @@ class AccessAuth
         'manager/login/wechat',
         'manager/login/auth_rules',
         'manager/upload/uploadimg',
-        'manager/upload/get_sign_url'
+        'manager/upload/get_sign_url',
+        'manager/personnel_employee/personal_info'
     ];
     //默认配置
     protected   $_config    = [

+ 1 - 0
app/Http/Requests/Api/Personnel/Employee.php

@@ -47,6 +47,7 @@ class Employee extends BaseRequest
         'edit'                  => ['id','name', 'mobile','department_id','role_id','open_notice'],
         'set_status'              => ['id', 'status'],
         'delete'                  => ['id'],
+        'personal_info'           => [],
     ];
 
     /**

+ 64 - 0
app/Http/Requests/Api/Personnel/Subscribe.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace App\Http\Requests\Api\Personnel;
+
+use App\Http\Requests\BaseRequest;
+
+/**
+ * 员工订阅管理-请求类
+ * @author 唐远望
+ * @version 1.0
+ * @date 2026-03-03
+ * 
+ */
+class Subscribe extends BaseRequest
+{
+    /**
+     * 获取应用于请求的规则
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        // 返回结果
+        return      [
+            'name'                 => 'required',
+            'id'                => 'required|integer|gt:0',
+            'status'            => 'required|integer|in:0,1',
+            'page'              => 'integer|min:1',
+            'limit'             => 'integer|min:1',
+            'open_subscribe'    => 'required|integer|in:0,1',
+        ];
+    }
+
+
+    // 场景列表
+    protected   $scenes         = [
+        'change_subscribe'             => ['open_subscribe'],
+    ];
+
+    /**
+     * 获取已定义验证规则的错误消息
+     *
+     * @return array
+     */
+    public function messages()
+    {
+        return [
+            'name.required'     => '姓名必填',
+            'id.required'       => 'ID未知',
+            'id.integer'        => 'ID格式错误',
+            'id.gt'               => 'ID格式错误',
+            'status.required'   => '状态未知',
+            'status.integer'    => '状态格式错误',
+            'status.in'         => '状态格式错误',
+            'page.integer'      => '页码格式错误',
+            'page.min'          => '页码格式错误',
+            'limit.integer'     => '每页数量格式错误',
+            'limit.min'         => '每页数量格式错误',
+            'open_subscribe.required'   => '订阅状态未知',
+            'open_subscribe.integer'    => '订阅状态格式错误',
+            'open_subscribe.in'         => '订阅状态格式错误',
+        ];
+    }
+}

+ 1 - 0
app/Http/Requests/Manager/Personnel/Employee.php

@@ -49,6 +49,7 @@ class Employee extends BaseRequest
         'set_status'              => ['id', 'status'],
         'delete'                  => ['id'],
         'all'                    => [''],
+        'personal_info'         => [],
     ];
 
     /**

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

@@ -165,6 +165,7 @@ class LowPriceGoodsDataJobs implements ShouldQueue
                 'first_responsible_person' => '',
                 'responsible_person' => '',
                 'source_responsible_person' => '',
+                'scrape_date' => $product_data['scrape_date'],
             ];
             //获取公司绑定责任人信息
             $company_data = $ViolationStoreModel->leftjoin('washconfig_company_category', 'washconfig_company_category.id', '=', 'washconfig_violation_store.category_id')

+ 199 - 0
app/Jobs/Manager/Process/Subscription.php

@@ -0,0 +1,199 @@
+<?php
+
+namespace App\Jobs\Manager\Process;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+use App\Models\Manager\Personnel\Employee as EmployeeModel;
+use App\Facades\Servers\Wechat\Official;
+use App\Facades\Servers\Logs\Log;
+use Illuminate\Support\Carbon;
+use App\Models\Manager\Process\LowPriceGoodsMember as LowPriceGoodsMemberModel;
+use App\Models\Manager\Process\ViolationProductMember as ViolationProductMemberModel;
+use Illuminate\Support\Facades\DB;
+
+
+
+/**
+ * 订阅消息通知推送
+ * @author  唐远望
+ * @version 1.0
+ * @date  2026-03-04
+ */
+class Subscription implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+    protected $message_data;
+    /**
+     * Create a new job instance.
+     *
+     * @return void
+     */
+    public function __construct(array $message_data)
+    {
+        $this->message_data = $message_data;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        try {
+            $notice_type = $this->message_data['notice_type'];
+            $map = [];
+            $todayStart = Carbon::today()->startOfDay()->getTimestamp(); // 今天开始时间 00:00:00
+            $todayEnd = Carbon::today()->endOfDay()->getTimestamp(); // 今天结束时间 23:59:59
+            switch ($notice_type) {
+                case 'low_price_goods':
+                    $LowPriceGoodsMemberModel = new LowPriceGoodsMemberModel();
+
+                    //查询今日待处理低价商品责任人
+                    $map[] = ['process_lowprice_product.insert_time', '>=', $todayStart];
+                    $map[] = ['process_lowprice_product.insert_time', '<=', $todayEnd];
+
+                    $process_data = $LowPriceGoodsMemberModel
+                        ->join('process_lowprice_product', 'process_lowprice_product_member.lowprice_product_logid', '=', 'process_lowprice_product.id')
+                        ->where($map)
+                        ->where([
+                            'process_lowprice_product.processing_status' => '1',
+                            'process_lowprice_product_member.duty_type' => '1'
+                        ])
+                        ->groupBy('process_lowprice_product_member.employee_id') // 按员工ID分组
+                        ->select(
+                            'process_lowprice_product_member.employee_id',
+                            DB::raw('count(*) as total_number') // 统计每个员工的数量
+                        )
+                        ->get();
+
+                    if (empty($process_data)) {
+                        return true;
+                    }
+
+                    // 转换为原来的数组格式
+                    $user_id_list = [];
+                    foreach ($process_data as $value) {
+                        $user_id_list[$value->employee_id] = [
+                            'totle_number' => $value->total_number
+                        ];
+                    }
+                    $this->send_low_price_goods_notice($user_id_list);
+                    break;
+                case 'violation_product':
+                    $ViolationProductMemberModel = new ViolationProductMemberModel();
+
+                    //查询今日待处理禁止商品责任人
+                    $map[] = ['process_violation_product.insert_time', '>=', $todayStart];
+                    $map[] = ['process_violation_product.insert_time', '<=', $todayEnd];
+
+                    $process_data = $ViolationProductMemberModel
+                        ->join('process_violation_product', 'process_violation_product_member.lowprice_product_logid', '=', 'process_violation_product.id')
+                        ->where($map)
+                        ->where(['process_violation_product.processing_status' => '1', 'process_violation_product_member.duty_type' => '1'])
+                        ->groupBy('process_violation_product_member.employee_id') // 按员工ID分组
+                        ->select(
+                            'process_violation_product_member.employee_id',
+                            DB::raw('count(*) as total_number') // 统计每个员工的数量
+                        )
+                        ->get();
+
+                    if (empty($process_data)) {
+                        return true;
+                    }
+
+                    // 转换为数组格式(如果需要原来的格式)
+                    $user_id_list = [];
+                    foreach ($process_data as $value) {
+                        $user_id_list[$value['employee_id']] = [
+                            'totle_number' => $value['total_number']
+                        ];
+                    }
+                    $this->send_violation_product($user_id_list);
+                    break;
+                default:
+                    break;
+            }
+        } catch (\Exception $e) {
+            Log::info('job_error', '订阅消息通知推送队列失败', ['data' => $this->message_data, 'error' => $e->getMessage()]);
+        }
+    }
+
+    /**
+     * 公众号消息订阅推送(低价挂网)
+     * @author  唐远望
+     * @version 1.0
+     * @date  2026-03-04
+     */
+    private function send_low_price_goods_notice($user_id_list)
+    {
+        $EmployeeModel = new EmployeeModel();
+        foreach ($user_id_list as $key => $totle_number) {
+            $user_info  = $EmployeeModel->where('id', $key)->where([['open_subscribe', '=', 0], ['status', '=', 1]])->first(['openid']);
+            if (empty($user_info)) return true;
+            if ($user_info['openid'] == '') return true;
+            $data           = [
+                'thing1'    => '数据违规预警',
+                'thing2'    => '低价挂网商品:共【' . $totle_number . '】条',
+                'time7'     => strtotime(time(), 'Y:m:d H:i:s'),
+                'phrase9'   => '待处理',
+            ];
+            $params     = [
+                'touser'            => $user_info['openid'],
+                'template_id'       => 't559Iagds7Av-YcqwIpeAaS5gt7LuOKuIBDvVKlyfm8',
+                'url'               => '',
+                'data'              => $data,
+            ];
+            //发送模板消息
+            $result     = Official::sendSubscription($params);
+            if (!empty($result) && isset($result['error'])) {
+                Log::info('job_notice', '公众号消息订阅推送失败', ['data' => $params, 'error' => $result]);
+            }
+        }
+    }
+
+    /**
+     * 公众号消息订阅推送(禁止挂网)
+     * @author  唐远望
+     * @version 1.0
+     * @date  2026-03-04
+     */
+    private function send_violation_product($user_id_list)
+    {
+        $EmployeeModel = new EmployeeModel();
+        foreach ($user_id_list as $key => $totle_number) {
+            $user_info  = $EmployeeModel->where('id', $key)->where([['open_subscribe', '=', 0], ['status', '=', 1]])->first(['openid']);
+            if (empty($user_info)) return true;
+            if ($user_info['openid'] == '') return true;
+            $data           = [
+                'thing1'    => '数据违规预警',
+                'thing2'    => '禁止挂网商品:共【' . $totle_number . '】条',
+                'time7'     => strtotime(time(), 'Y:m:d H:i:s'),
+                'phrase9'   => '待处理',
+            ];
+            $params     = [
+                'touser'            => $user_info['openid'],
+                'template_id'       => 't559Iagds7Av-YcqwIpeAaS5gt7LuOKuIBDvVKlyfm8',
+                'url'               => '',
+                'data'              => $data,
+            ];
+            //发送模板消息
+            $result     = Official::sendSubscription($params);
+            if (!empty($result) && isset($result['error'])) {
+                Log::info('job_notice', '公众号消息订阅推送失败', ['data' => $params, 'error' => $result]);
+            }
+        }
+    }
+
+
+
+    public function failed(\Throwable $exception)
+    {
+        Log::info('job_error', '订阅消息通知推送队列完全失败', ['data' => $this->message_data, 'error' => $exception]);
+    }
+}

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

@@ -160,6 +160,7 @@ class ViolationProductDataJobs implements ShouldQueue
                 'first_responsible_person' => '',
                 'responsible_person' => '',
                 'source_responsible_person' => '',
+                'scrape_date' => $product_data['scrape_date'],
             ];
             //获取公司绑定责任人信息
             $company_data = $ViolationStoreModel->leftjoin('washconfig_company_category', 'washconfig_company_category.id', '=', 'washconfig_violation_store.category_id')

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

@@ -146,6 +146,7 @@ class ViolationStoreDataJobs implements ShouldQueue
                 'first_responsible_person' => '',
                 'responsible_person' => '',
                 'source_responsible_person' => '',
+                'scrape_date' => $product_data['scrape_date'],
             ];
             //获取公司绑定责任人信息
             $company_data = $ViolationStoreModel->where('social_credit_code', $product_data['qualification_number'])

+ 246 - 0
app/Models/Api/Citys.php

@@ -0,0 +1,246 @@
+<?php
+
+namespace App\Models\Api;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 城市模型
+ * 
+ */
+class Citys extends Model
+{
+    use HasFactory;
+
+    // 与模型关联的表名
+    protected $table = 'city';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+    /**
+     * 添加数据
+     * 
+     */
+    public function add($data)
+    {
+        // 时间
+        $data['insert_time']                = time();
+        $data['update_time']                = time();
+        // 写入数据表
+        $id                                    = $this->query()->insertGetId($data);
+        // 失败返回0
+        if (!$id)                          return 0;
+        // 返回结果
+        return                              $id;
+    }
+
+    /**
+     * 添加数据
+     * 
+     */
+    public function edit($id, $data)
+    {
+        // 更新时间
+        $data['update_time']                = time();
+        // 写入数据表
+        $result                                = $this->query()->where([['id', '=', $id]])->update($data);
+        // 失败返回0
+        if (!$result)                      return 0;
+        // 返回结果
+        return                              $id;
+    }
+
+
+
+    /**
+     * 获取列表
+     * @param   Bool    $force  是否强制更新
+     * 
+     */
+    public function getList($force = false)
+    {
+        // 结果数据
+        $list                  = $force ? [] : cache('admin:city:list');
+        // 不存在数据
+        if (!$list) {
+            // 从数据库获取数据
+            $data              = $this->query()->where([['status', '=', 0], ['level', '<', 3]])->get(['id', 'name', 'pid']);
+            // 是否有数据
+            $data              = $data ? $data->toArray() : [];
+            // 循环处理数据
+            $list              = [];
+            // 进行更新
+            foreach ($data as $value) {
+                // 重组数据
+                $list[$value['id']] = $value;
+            }
+            $list = $this->getTree($list);
+            // 存起来
+            cache(['admin:city:list' => $list]);
+        }
+
+        // 返回结果
+        return                  $list;
+    }
+
+    /**
+     * 获取城市ID列表
+     * @param   Bool    $force  是否强制更新
+     * 
+     */
+    public function get_city_id_list($force = false)
+    {
+        // 结果数据
+        $list                  = $force ? [] : cache('admin:city_id:list');
+        // 不存在数据
+        if (!$list) {
+            // 从数据库获取数据
+            $data              = $this->query()->where([['status', '=', 0], ['level', '<=', 2]])->get(['id', 'name', 'pid'])->keyBy('name')->toarray();
+            // 是否有数据
+            $list              = $data ? $data : [];
+            // 存起来
+            cache(['admin:city_id:list' => $list]);
+        }
+        // 返回结果
+        return                  $list;
+    }
+
+    /**
+     * 获取省份ID列表
+     * @param   Bool    $force  是否强制更新
+     * 
+     */
+    public function get_province_id_list($force = false)
+    {
+        // 结果数据
+        $list                  = $force ? [] : cache('admin:province_id:list');
+        // 不存在数据
+        if (!$list) {
+            // 从数据库获取数据
+            $data              = $this->query()->where([['status', '=', 0], ['level', '=', 1]])->get(['id', 'name', 'pid'])->keyBy('name')->toarray();
+            // 是否有数据
+            $list              = $data ? $data : [];
+            // 存起来
+            cache(['admin:province_id:list' => $list]);
+        }
+        // 返回结果
+        return                  $list;
+    }
+
+
+
+    /**
+     * 获取某个
+     * 
+     * @param   int         $id     ID
+     * @param   string     $field   指定字段
+     * 
+     */
+    public function getOne($id, $field = '')
+    {
+        // 获取列表数据
+        $list                   = $this->getList();
+        // 获取数据
+        $one                    = isset($list[$id]) ? $list[$id] : [];
+        // 返回值
+        return                  empty($field) ? $one : (isset($one[$field]) ? $one[$field] : null);
+    }
+
+
+    /**
+     * 获取某个地区名称
+     * @author 唐远望
+     * @verson 1.0
+     * @date 2025-12-23
+     * 
+     */
+    public function get_city_name($id, $force = false)
+    {
+        $list                  = $force ? [] : cache('admin:city:source_list_name');
+        // 不存在数据
+        if (!$list) {
+            // 获取列表数据
+            $list_data              = $this->query()->where([['status', '=', 0], ['level', '<', 3]])->get(['id', 'name', 'pid'])->toArray();
+            if (!empty($list_data)) {
+                foreach ($list_data as $key => $value) {
+                    $list[$value['id']] = $value['name'];
+                }
+            }
+            cache(['admin:city:source_list_name' => $list]);
+        }
+        // 获取数据
+        $one                    = isset($list[$id]) ? $list[$id] : [];
+        // 返回值
+        return                 $one;
+    }
+
+    /**
+     * 获取城市对应的ID
+     * 
+     * @param   string         $name 城市名
+     * 
+     */
+    public function getIdByName($name)
+    {
+        // 返回结果
+        return                  (int) $this->query()->where([['name', '=', $name]])->value('id');
+    }
+
+    /**
+     * 获取城市列表
+     * 
+     */
+    public function getCityList()
+    {
+        // 城市json
+        $cityList               = @file_get_contents(resource_path('./js/') . 'city.json');
+        // 解码
+        $cityList               = (array) json_decode($cityList, true);
+        // 返回结果
+        return                  $cityList;
+    }
+
+    /**
+
+     * 无限极分类
+
+     * @param type $array
+
+     * @return type $new_array
+
+     */
+
+    public function getTree($array)
+    {
+
+        //遍历数组,按照id作为键名重新组建新的数组
+
+        $new_array = [];
+
+        foreach ($array as $v) {
+
+            $new_array[$v['id']] = $v;
+        }
+
+        //遍历新的数组,对每一个值的pid进行判断,判断新数组中是否存在键名为pid的值,如果存在,当前值为存在的pid的子节点,不存在,当前值为一级节点,添加到返回的数据中作为一级节点。这里使用引用传值是因为直接传值是不会影响到函数外边的变量值,我们这里要给一级节点添加子节点(sons),所以需要用到引用传值。
+
+        $return_tree = [];
+
+        foreach ($new_array as $kk => $vv) {
+
+            if (isset($new_array[$vv['pid']])) {
+
+                $new_array[$vv['pid']]['sons'][] = &$new_array[$kk];
+            } else {
+
+                $return_tree[] = &$new_array[$kk];
+            }
+        }
+
+        return $return_tree;
+    }
+}

+ 148 - 0
app/Models/Api/Personnel/Department.php

@@ -0,0 +1,148 @@
+<?php
+
+namespace App\Models\Api\Personnel;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 部门模型
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-04
+ */
+class Department extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'personnel_department';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-04
+     */
+    public function addDepartment_content($data)
+    {
+        $insert_data = [
+            'name' => $data['name'],
+            'company_id'=> $data['company_id'],
+            'insert_time' => time(),
+        ];
+        $Department_id = $this->insertGetId($insert_data);
+        return $Department_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-04
+     * @param $data
+     * @return bool
+     */
+    public function addDepartment($data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->addDepartment_content($data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-04
+     * @param $data
+     * @return bool
+     */
+    public function editDepartment_content($Department, $data)
+    {
+        $Department->name = $data['name'];
+        $Department->update_time = time();
+        $Department->save();
+        return true;
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-04
+     * @param $data
+     * @return bool
+     */
+    public function updateDepartment($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->editDepartment_content($where, $data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-04
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $Department = $this->where($where)->first();
+        if (!$Department) {
+            return false;
+        }
+        $Department->status = $status;
+        $Department->update_time = time();
+        $Department->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-04
+     * @param $id
+     * @return bool
+     */
+    public function deleteDepartment($where)
+    {
+        $Department = $this->where($where)->first();
+        if (!$Department) {
+            return false;
+        }
+        $Department->delete();
+        return true;
+    }
+}

+ 2 - 2
app/Models/Api/Personnel/Employee.php

@@ -30,10 +30,10 @@ class Employee extends Model
      * @param   int      用户ID
      * 
      */
-    public function Login($uid, $module = 'api')
+    public function Login($uid,$company_id=0, $module = 'api')
     {
         // 组合数据
-        $jwtData                            = ['uid' => $uid, 'type' => $module, 'expire' => time() + 86400 * 7];
+        $jwtData                            = ['company_id'=>$company_id, 'uid' => $uid, 'type' => $module, 'expire' => time() + 86400 * 7];
         // 登录成功
         $token                              = AccessToken::encode($jwtData);
         // 如果异常的话

+ 153 - 0
app/Models/Api/Personnel/Roles.php

@@ -0,0 +1,153 @@
+<?php
+
+namespace App\Models\Api\Personnel;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+use App\Models\Manager\Personnel\RolesAuthRule as RolesAuthRuleModel;
+
+/**
+ * 角色模型
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-05
+ */
+class Roles extends Model
+{
+   use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'personnel_roles';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-05
+     */
+    public function addRoles_content($data)
+    {
+        $insert_data = [
+            'name' => $data['name'],
+            'company_id' => $data['company_id'],
+            'insert_time' => time(),
+        ];
+        $Roles_id = $this->insertGetId($insert_data);
+        return $Roles_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-05
+     * @param $data
+     * @return bool
+     */
+    public function addRoles($data)
+    {
+        $RolesAuthRuleModel = new RolesAuthRuleModel();
+        DB::beginTransaction();
+        try {
+            $role_id=$this->addRoles_content($data);
+            $RolesAuthRuleModel->addRolesAuthRule(['role_id'=> $role_id,'menu_ids'=>$data['menu_ids']]);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-05
+     * @param $data
+     * @return bool
+     */
+    public function editRoles_content($Roles, $data)
+    {
+        $Roles->name = $data['name'];
+        $Roles->update_time = time();
+        $Roles->save();
+        return true;
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-05
+     * @param $data
+     * @return bool
+     */
+    public function updateRoles($Roles, $data)
+    {
+        $RolesAuthRuleModel = new RolesAuthRuleModel();
+        DB::beginTransaction();
+        try {
+            $this->editRoles_content($Roles, $data);
+            $RolesAuthRuleModel->addRolesAuthRule(['role_id'=> $Roles->id,'menu_ids'=>$data['menu_ids']]);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-05
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $Roles = $this->where($where)->first();
+        if (!$Roles) {
+            return false;
+        }
+        $Roles->status = $status;
+        $Roles->update_time = time();
+        $Roles->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-05
+     * @param $id
+     * @return bool
+     */
+    public function deleteRoles($where)
+    {
+        $Roles = $this->where($where)->first();
+        if (!$Roles) {
+            return false;
+        }
+        $Roles->delete();
+        return true;
+    }
+}

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

@@ -76,6 +76,7 @@ class LowPriceGoods extends Model
             'source_responsible_person'    => $data['source_responsible_person'],
             'processing_status' => '1',
             'insert_time' => time(),
+            'scrape_date' => isset($data['scrape_date']) ? $data['scrape_date'] : '',
         ];
         $LowPriceGoods_id = $this->insertGetId($insert_data);
         return $LowPriceGoods_id;
@@ -132,6 +133,7 @@ class LowPriceGoods extends Model
                 'company_category_name' => $data['company_category_name'],
                 'processing_status' => '1',
                 'insert_time' => time(),
+                'scrape_date' => isset($data['scrape_date']) ? $data['scrape_date'] : '',
             ];
 
             $LowPriceGoods_id = $this->insertGetId($insert_data);

+ 2 - 0
app/Models/Manager/Process/ViolationProduct.php

@@ -73,6 +73,7 @@ class ViolationProduct extends Model
             'source_responsible_person'    => $data['source_responsible_person'],
             'processing_status' => '1',
             'insert_time' => time(),
+            'scrape_date' => isset($data['scrape_date']) ? $data['scrape_date'] : '',
         ];
         $ViolationProduct_id = $this->insertGetId($insert_data);
         return $ViolationProduct_id;
@@ -126,6 +127,7 @@ class ViolationProduct extends Model
                 'company_category_name' => $data['company_category_name'],
                 'processing_status' => '1',
                 'insert_time' => time(),
+                'scrape_date' => isset($data['scrape_date']) ? $data['scrape_date'] : '',
             ];
             $ViolationProduct_id = $this->insertGetId($insert_data);
             $first_responsible_persons = $data['first_responsible_person'] != '' ? explode(',', $data['first_responsible_person']) : [];

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

@@ -53,6 +53,7 @@ class ViolationStore extends Model
             'company_category_name' => $data['company_category_name'] ? $data['company_category_name'] : '',
             'processing_status' => '1',
             'insert_time' => time(),
+            'scrape_date' => isset($data['scrape_date']) ? $data['scrape_date'] : '',
         ];
         $ViolationStore_id = $this->insertGetId($insert_data);
         return $ViolationStore_id;
@@ -98,6 +99,7 @@ class ViolationStore extends Model
                 'company_category_name' => $data['company_category_name'] ? $data['company_category_name'] : '',
                 'processing_status' => '1',
                 'insert_time' => time(),
+                'scrape_date' => isset($data['scrape_date']) ? $data['scrape_date'] : '',
             ];
             $ViolationStore_id = $this->insertGetId($insert_data);
             $first_responsible_persons = $data['first_responsible_person'] != '' ? explode(',', $data['first_responsible_person']) : [];

+ 98 - 0
app/Servers/Wechat/Official.php

@@ -0,0 +1,98 @@
+<?php namespace App\Servers\Wechat;
+
+use EasyWeChat\Factory;
+
+/**
+ * 微信公众号
+ * 
+ */
+class Official
+{
+    // 工作列表
+    protected \EasyWeChat\OfficialAccount\Application  $app;
+
+    // 构造函数
+    public function __construct(){
+        // 应用实例
+        $this->app                          = $this->getApp();
+    }
+
+    /**
+     * 获取应用实例
+     * 
+     * @return \EasyWeChat\OfficialAccount\Application
+     * 
+     */
+    public function getApp(){
+        // 获取配置
+		$this->app                          = Factory::officialAccount(config('wechat.official',[]));
+        // 返回结果
+        return                              $this->app;
+    }
+
+    /**
+     * 获取user
+     * @param  string   $code           通过 前端授权code获取用户openid
+     *
+     *
+     */
+    public function userFromCode($code){
+        // 获取手机号
+        $result							    = $this->app->oauth->userFromCode($code);
+        // 判断结果
+        if( !empty($result['errcode']) )    return ['error'=>$result['errcode'].'=>'.$result['errmsg']];
+        // 获取不包含区号的手机号(因为绑定手机号字段会有国际区号)
+        return                              $result;
+    }
+
+    /**
+     * 获取JSSDK的配置数组
+     * @return array
+     */
+    public function getJssdkConfig($url=''){
+        // 如果指定路径的话
+        if( $url )                          $this->app->jssdk->setUrl($url);
+        // 获取JSSDK的配置对象
+        $config                             = $this->app->jssdk->buildConfig(['updateAppMessageShareData','updateTimelineShareData'],false,false,false);
+        // 获取JSSDK的配置数组
+        return                              $config;
+    }
+    /**
+     * 发送一次性订阅消息
+     * @param array $params
+     *
+     */
+    public function sendSubscription($params){
+        // 获取手机号
+        $result							    = $this->app->template_message->sendSubscription([
+            'touser' => $params['openid'],
+            'template_id' => 'template-id',
+            'url' => $params['url'],
+            'scene' => 1000,
+            'data' => $params['data'],
+        ]);
+        // 判断结果
+        if( !empty($result['errcode']) )    return ['error'=>$result['errcode'].'=>'.$result['errmsg']];
+        // 获取不包含区号的手机号(因为绑定手机号字段会有国际区号)
+        return                              $result;
+    }
+    /**
+     * 发送模板消息
+     * @param array $params
+     *
+     */
+    public function send($params){
+        // 获取手机号
+        $result							    = $this->app->template_message->send([
+            'touser' => $params['openid'],
+            'template_id' => 'template-id',
+            'url' => $params['url'],
+            'scene' => 1000,
+            'data' => $params['data'],
+        ]);
+        // 判断结果
+        if( !empty($result['errcode']) )    return ['error'=>$result['errcode'].'=>'.$result['errmsg']];
+        // 获取不包含区号的手机号(因为绑定手机号字段会有国际区号)
+        return                              $result;
+    }
+}

+ 2 - 2
app/Servers/Wechat/WeChatWebApp.php

@@ -1,6 +1,7 @@
 <?php
 
 namespace App\Servers\Wechat;
+use App\Facades\Servers\Logs\Log;
 
 /**
  * 微信网站应用
@@ -273,8 +274,7 @@ class WeChatWebApp
         if ($data !== null) {
             $log .= " - " . (is_array($data) ? json_encode($data) : $data);
         }
-
-        error_log($log . PHP_EOL, 3, 'wechat_oauth_error.log');
+        Log::info('wechat_oauth_error', '微信登录错误日志', ['data' => $log, 'error' => PHP_EOL]);
     }
 
     /**

+ 6 - 2
composer.json

@@ -22,7 +22,8 @@
         "laravel/tinker": "^2.5",
         "phpoffice/phpspreadsheet": "^1.12",
         "vinkla/hashids": "^9.1",
-        "wantp/snowflake": "^1.2"
+        "wantp/snowflake": "^1.2",
+        "w7corp/easywechat": "^5.35"
     },
     "require-dev": {
         "facade/ignition": "^2.5",
@@ -70,7 +71,10 @@
     "config": {
         "optimize-autoloader": true,
         "preferred-install": "dist",
-        "sort-packages": true
+        "sort-packages": true,
+        "allow-plugins": {
+            "easywechat-composer/easywechat-composer": true
+        }
     },
     "minimum-stability": "dev",
     "prefer-stable": true

Fișier diff suprimat deoarece este prea mare
+ 370 - 319
composer.lock


+ 11 - 6
config/wechat.php

@@ -13,12 +13,17 @@ return [
         ],
     ],
     'openplat' => [
-        'app_id'               => env('WECHAT_OPENPLAT_APP_ID', 'wx2386988b9b706ff5'),
-        'secret'               => env('WECHAT_OPENPLAT_SECRET', '3b487dd62a738939bb833f928d4fa4bd'),
-        'token'                => env('WECHAT_OPENPLAT_TOKEN', 'Afd61RPH3GzEwfEATRwdJVKhy'),
-        'aes_key'              => env('WECHAT_OPENPLAT_AES_KEY', 'FL1brptJzQeDMwp5nvuojb8YEDx9GXy9kxaQ8JQl2Zi'),
-        'host_url'             => env('WECHAT_OPENPLAT_HOST_URL', 'https://retrieveapi.dfwy.tech/'),
-        'release_host_url'     => env('WECHAT_OPENPLAT_RELEASE_HOST_URL', 'https://retrieveapi.findit.ltd/'),
+        'app_id'               => env('WECHAT_OPENPLAT_APP_ID', 'wxa0567dbde0434a27'),//微信开放平台应用ID
+        'secret'               => env('WECHAT_OPENPLAT_SECRET', '3c0cde2e91fe46813209d637222da24b'),//微信开放平台应用秘钥
+        'token'                => env('WECHAT_OPENPLAT_TOKEN', ''),//微信开放平台应用令牌
+        'aes_key'              => env('WECHAT_OPENPLAT_AES_KEY', ''),//微信开放平台应用消息加解密密钥
+        'host_url'             => env('WECHAT_OPENPLAT_HOST_URL', 'https://retrieveapi.dfwy.tech/'),//微信开放平台接口地址
+        'release_host_url'     => env('WECHAT_OPENPLAT_RELEASE_HOST_URL', 'https://retrieveapi.findit.ltd/'),//微信开放平台接口地址
+    ],
+    'official' => [
+        'app_id' => env('OFFICIAL_APP_ID', 'wxf7d79ce0e2f85092'),//微信公众平台应用ID
+        'secret' => env('OFFICIAL_SECRET', '3c0cde2e91fe46813209d637222da24b'),//微信公众平台应用秘钥(已转移到微信开放平台设置)
+        'response_type' => 'array',
     ],
 
 ];

+ 6 - 1
routes/api.php

@@ -57,6 +57,8 @@ Route::any('process/violation_store/set_processing_status', [App\Http\Controller
 
 // 员工管理-列表
 Route::any('personnel_employee/list', [App\Http\Controllers\Api\Personnel\Employee::class, 'list']);
+// 员工管理-个人信息详情
+Route::any('personnel_employee/personal_info', [App\Http\Controllers\Api\Personnel\Employee::class, 'personal_info']);
 
 // ------数据清洗配置------
 // 低价商品-列表
@@ -75,4 +77,7 @@ Route::any('violation_goods/list', [App\Http\Controllers\Api\WashConfig\Violatio
 Route::any('violation_goods_spec/list', [App\Http\Controllers\Api\WashConfig\ViolationProduct::class, 'spec_list']);
 
 // 违规店铺公司-列表
-Route::any('violation_store/list', [App\Http\Controllers\Api\WashConfig\ViolationStore::class, 'list']);
+Route::any('violation_store/list', [App\Http\Controllers\Api\WashConfig\ViolationStore::class, 'list']);
+
+//订阅服务-订阅开关
+Route::any('personnel/subscribe/change_subscribe', [App\Http\Controllers\Api\Personnel\Subscribe::class, 'change_subscribe']);

+ 3 - 0
routes/manager.php

@@ -172,6 +172,9 @@ Route::any('personnel_employee/set_status', [App\Http\Controllers\Manager\Person
 Route::any('personnel_employee/delete', [App\Http\Controllers\Manager\Personnel\Employee::class, 'delete']);
 // 员工管理-全部
 Route::any('personnel_employee/all', [App\Http\Controllers\Manager\Personnel\Employee::class, 'all']);
+// 员工管理-个人信息详情
+Route::any('personnel_employee/personal_info', [App\Http\Controllers\Manager\Personnel\Employee::class, 'personal_info']);
+
 
 //部门管理-列表
 Route::any('personnel_department/list', [App\Http\Controllers\Manager\Personnel\Department::class, 'list']);

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff