作者 Your Name

gx

@@ -18,5 +18,4 @@ final class Common extends Enum @@ -18,5 +18,4 @@ final class Common extends Enum
18 //端 18 //端
19 const A='a'; 19 const A='a';
20 const B='b'; 20 const B='b';
21 - const C='c';  
22 } 21 }
1 -<?php  
2 -  
3 -namespace App\Exceptions;  
4 -  
5 -use App\Enums\Common\Code;  
6 -use Exception;  
7 -use Throwable;  
8 -  
9 -/**  
10 - * @notes: C端接口统一错误格式  
11 - * Class CsideGlobalException  
12 - * @package App\Exceptions  
13 - */  
14 -class CsideGlobalException extends Exception  
15 -{  
16 - public function __construct($code = 0, $message = "", Throwable $previous = null)  
17 - {  
18 - $this->code = $code;  
19 - $this->message = $message;  
20 - if (empty($this->message)) {  
21 - $this->message = Code::fromValue($code)->description;  
22 - }  
23 - }  
24 -}  
@@ -72,10 +72,6 @@ class Handler extends ExceptionHandler @@ -72,10 +72,6 @@ class Handler extends ExceptionHandler
72 elseif($exception instanceof BsideGlobalException) { 72 elseif($exception instanceof BsideGlobalException) {
73 LogUtils::error("BsideGlobalException", [], $exceptionMessage); 73 LogUtils::error("BsideGlobalException", [], $exceptionMessage);
74 } 74 }
75 - //C端错误  
76 - elseif($exception instanceof CsideGlobalException) {  
77 - LogUtils::error("CsideGlobalException", [], $exceptionMessage);  
78 - }  
79 //验证错误(非手动抛出) 75 //验证错误(非手动抛出)
80 elseif ($exception instanceof ValidationException) { 76 elseif ($exception instanceof ValidationException) {
81 LogUtils::error("参数验证失败", [], $exceptionMessage); 77 LogUtils::error("参数验证失败", [], $exceptionMessage);
@@ -114,9 +110,7 @@ class Handler extends ExceptionHandler @@ -114,9 +110,7 @@ class Handler extends ExceptionHandler
114 $code = $exception->getCode(); 110 $code = $exception->getCode();
115 }elseif ($exception instanceof BsideGlobalException) { 111 }elseif ($exception instanceof BsideGlobalException) {
116 $code = $exception->getCode(); 112 $code = $exception->getCode();
117 - }elseif ($exception instanceof CsideGlobalException) {  
118 - $code = $exception->getCode();  
119 - } elseif ($exception instanceof ValidationException) { 113 + }elseif ($exception instanceof ValidationException) {
120 $code = Code::USER_PARAMS_ERROE(); 114 $code = Code::USER_PARAMS_ERROE();
121 $message = $code->description = Arr::first(Arr::first($exception->errors())); 115 $message = $code->description = Arr::first(Arr::first($exception->errors()));
122 } elseif ($exception instanceof NotFoundHttpException || $exception instanceof MethodNotAllowedHttpException) { 116 } elseif ($exception instanceof NotFoundHttpException || $exception instanceof MethodNotAllowedHttpException) {
  1 +<?php
  2 +
  3 +
  4 +namespace App\Helper;
  5 +
  6 +use App\Utils\HttpUtils;
  7 +use GuzzleHttp\Exception\GuzzleException;
  8 +
  9 +
  10 +/**
  11 + * Class FormGlobalsoApi
  12 + * @package App\Helper
  13 + * @author zbj
  14 + * @date 2023/5/17
  15 + */
  16 +class FormGlobalsoApi
  17 +{
  18 + //接口地址
  19 + protected $url = 'https://form.globalso.com';
  20 +
  21 + /**
  22 + * 设置询盘通知
  23 + * @author zbj
  24 + * @date 2023/5/17
  25 + */
  26 + public function setInquiry($domain, $emails, $phones)
  27 + {
  28 + $api_url = $this->url . '/api/external-project/save/dc77a54480b184c4';
  29 +
  30 + $params = [
  31 + 'token' => md5($domain.$emails.$phones.date("Y-m-d")),
  32 + 'domain' => $domain,
  33 + 'email' => $emails,
  34 + 'phone' => $phones,
  35 + ];
  36 +
  37 + try {
  38 + $res = HttpUtils::get($api_url, $params);
  39 + $res = Arr::s2a($res);
  40 + } catch (\Exception | GuzzleException $e) {
  41 + errorLog('设置询盘通知', $params, $e);
  42 + return false;
  43 + }
  44 + return $res;
  45 + }
  46 +
  47 + /**
  48 + * 询盘列表
  49 + * @author zbj
  50 + * @date 2023/5/17
  51 + */
  52 + public function getInquiryList($domain, $search = '', $page = 1, $page_size = 20)
  53 + {
  54 + $api_url = $this->url . '/api/external-interface/6a1bd159b1fd60af';
  55 +
  56 + $params = [
  57 + 'token' => md5($domain.$search.date("Y-m-d")),
  58 + 'domain' => $domain,
  59 + 'limit' => $page_size,
  60 + 'page' => $page,
  61 + 'source' => '1,3' //来源类型 新项目用1,3
  62 + ];
  63 + if($search){
  64 + $params['name'] = $search;
  65 + }
  66 + try {
  67 + $res = HttpUtils::get($api_url, $params);
  68 + $res = Arr::s2a($res);
  69 + } catch (\Exception | GuzzleException $e) {
  70 + errorLog('询盘列表', $params, $e);
  71 + return false;
  72 + }
  73 + return $res;
  74 + }
  75 +
  76 + /**
  77 + * 设置询盘信息已读
  78 + * @author zbj
  79 + * @date 2023/5/17
  80 + */
  81 + public function saveInquiryRead($domain, $id)
  82 + {
  83 + $api_url = $this->url . '/api/external-interface/save/d1483a8e57cb485a';
  84 +
  85 + $params = [
  86 + 'token' => md5($domain.$id.date("Y-m-d")),
  87 + 'domain' => $domain,
  88 + 'id' => $id,
  89 + ];
  90 +
  91 + try {
  92 + $res = HttpUtils::get($api_url, $params);
  93 + $res = Arr::s2a($res);
  94 + } catch (\Exception | GuzzleException $e) {
  95 + errorLog('设置询盘信息已读', $params, $e);
  96 + return false;
  97 + }
  98 + return $res;
  99 + }
  100 +
  101 + /**
  102 + * 删除询盘信息
  103 + * @author zbj
  104 + * @date 2023/5/17
  105 + */
  106 + public function delInquiry($domain, $ids)
  107 + {
  108 + $api_url = $this->url . '/api/external-interface/del/c4b11cf6f1508489';
  109 + $ids = Arr::arrToSet($ids);
  110 + $params = [
  111 + 'token' => md5($domain.$ids.date("Y-m-d")),
  112 + 'domain' => $domain,
  113 + 'id' => $ids,
  114 + ];
  115 + try {
  116 + $res = HttpUtils::get($api_url, $params);
  117 + $res = Arr::s2a($res);
  118 + } catch (\Exception | GuzzleException $e) {
  119 + errorLog('删除询盘信息', $params, $e);
  120 + return false;
  121 + }
  122 + return $res;
  123 + }
  124 +}
@@ -2,16 +2,12 @@ @@ -2,16 +2,12 @@
2 2
3 namespace App\Http\Controllers\Bside; 3 namespace App\Http\Controllers\Bside;
4 4
5 -use App\Exceptions\BsideGlobalException;  
6 -use App\Helper\Arr; 5 +
7 use App\Http\Logic\Bside\InquiryLogic; 6 use App\Http\Logic\Bside\InquiryLogic;
8 -use App\Http\Requests\Bside\InquiryRequest;  
9 use App\Rules\Ids; 7 use App\Rules\Ids;
10 use App\Services\BatchExportService; 8 use App\Services\BatchExportService;
11 use Illuminate\Http\Request; 9 use Illuminate\Http\Request;
12 use Illuminate\Support\Facades\Storage; 10 use Illuminate\Support\Facades\Storage;
13 -use Illuminate\Validation\ValidationException;  
14 -use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;  
15 11
16 /** 12 /**
17 * 精准询盘 13 * 精准询盘
@@ -25,23 +21,18 @@ class InquiryController extends BaseController @@ -25,23 +21,18 @@ class InquiryController extends BaseController
25 21
26 public function index(InquiryLogic $logic) 22 public function index(InquiryLogic $logic)
27 { 23 {
28 - $map = [];  
29 - if(!empty($this->param['search'])){  
30 - $map[] = ['name|email|content', 'like', "%{$this->param['search']}%"];  
31 - }  
32 - $sort = ['id' => 'desc'];  
33 - $data = $logic->getList($map, $sort, ['id', 'name', 'email', 'phone', 'url', 'ip', 'ip_country', 'status', 'created_at']); 24 + $data = $logic->getApiList();
34 return $this->success($data); 25 return $this->success($data);
35 } 26 }
36 27
37 public function info(Request $request, InquiryLogic $logic){ 28 public function info(Request $request, InquiryLogic $logic){
38 $request->validate([ 29 $request->validate([
39 - 'id'=>'required' 30 + 'id' => 'required',
40 ],[ 31 ],[
41 'id.required' => 'ID不能为空' 32 'id.required' => 'ID不能为空'
42 ]); 33 ]);
43 $data = $logic->getInfo($this->param['id']); 34 $data = $logic->getInfo($this->param['id']);
44 - return $this->success(Arr::twoKeepKeys($data, ['id', 'name', 'email', 'phone', 'url', 'ip', 'ip_country', 'status', 'content', 'trans_content', 'created_at'])); 35 + return $this->success($data);
45 } 36 }
46 37
47 public function delete(Request $request, InquiryLogic $logic) 38 public function delete(Request $request, InquiryLogic $logic)
@@ -52,8 +43,8 @@ class InquiryController extends BaseController @@ -52,8 +43,8 @@ class InquiryController extends BaseController
52 'ids.required' => 'ID不能为空' 43 'ids.required' => 'ID不能为空'
53 ]); 44 ]);
54 45
55 - $data = $logic->delete($this->param['ids']);  
56 - return $this->success($data); 46 + $logic->delete($this->param['ids']);
  47 + return $this->success();
57 } 48 }
58 49
59 /** 50 /**
@@ -66,22 +57,20 @@ class InquiryController extends BaseController @@ -66,22 +57,20 @@ class InquiryController extends BaseController
66 */ 57 */
67 public function export(InquiryLogic $logic) 58 public function export(InquiryLogic $logic)
68 { 59 {
69 - $sort = ['id' => 'desc'];  
70 - //最多到1w条  
71 - $data = $logic->getList([], $sort, ['name', 'email', 'phone', 'url', 'ip', 'ip_country', 'content', 'created_at'], 10000); 60 + $data = $logic->getApiList(true);
72 $data = $data['list'] ?? []; 61 $data = $data['list'] ?? [];
73 foreach ($data as &$item){ 62 foreach ($data as &$item){
74 - $item['ip_address'] = "{$item['ip_country']}({$item['ip']})"; 63 + $item['ip_address'] = "{$item['country']}({$item['ip']})";
75 } 64 }
76 65
77 $map = [ 66 $map = [
78 - 'created_at' => '询盘发送时间', 67 + 'submit_time' => '询盘发送时间',
79 'name' => '姓名', 68 'name' => '姓名',
80 'email' => '邮箱', 69 'email' => '邮箱',
81 'phone' => '电话', 70 'phone' => '电话',
82 'ip_address' => '访问国家/地区(IP)', 71 'ip_address' => '访问国家/地区(IP)',
83 - 'url' => '发送页面',  
84 - 'content' => '询盘内容', 72 + 'refer' => '发送页面',
  73 + 'message' => '询盘内容',
85 ]; 74 ];
86 75
87 //生成文件,发送到客户端 76 //生成文件,发送到客户端
@@ -94,4 +83,17 @@ class InquiryController extends BaseController @@ -94,4 +83,17 @@ class InquiryController extends BaseController
94 // return Storage::disk('runtime')->download($file); //直接下载 83 // return Storage::disk('runtime')->download($file); //直接下载
95 return $this->success(['url' => $fileurl]); 84 return $this->success(['url' => $fileurl]);
96 } 85 }
  86 +
  87 + /**
  88 + * 询盘通知设置
  89 + * @author zbj
  90 + * @date 2023/5/17
  91 + */
  92 + public function set(Request $request, InquiryLogic $logic){
  93 + if($request->isMethod('get')){
  94 + return $this->success($logic->getSet());
  95 + }
  96 + $logic->saveSet();
  97 + return $this->success();
  98 + }
97 } 99 }
@@ -42,5 +42,10 @@ class DeptUserController extends BaseController @@ -42,5 +42,10 @@ class DeptUserController extends BaseController
42 */ 42 */
43 public function add(DeptUserLogic $deptUserLogic){ 43 public function add(DeptUserLogic $deptUserLogic){
44 $this->param['project_id'] = $this->user['project_id']; 44 $this->param['project_id'] = $this->user['project_id'];
  45 +<<<<<<< HEAD
  46 +=======
  47 + $deptUserLogic->dept_user_add();
  48 + $this->response('success');
  49 +>>>>>>> 8a42c22c01d5a3d48150b079338b5db1a01229cf
45 } 50 }
46 } 51 }
1 -<?php  
2 -  
3 -namespace App\Http\Controllers\Bside\User;  
4 -  
5 -use App\Enums\Common\Code;  
6 -use App\Http\Controllers\Bside\BaseController;  
7 -use App\Http\Controllers\Bside\Ids;  
8 -use App\Http\Controllers\Bside\json;  
9 -use App\Http\Logic\Bside\ProjectGroupLogic;  
10 -use App\Http\Logic\Bside\User\GroupLogic;  
11 -use App\Http\Requests\Bside\User\ProjectGroupRequest;  
12 -use App\Models\User\ProjectGroup;  
13 -  
14 -  
15 -/**  
16 - * @name:用户组相关  
17 - */  
18 -class ProjectGroupController extends BaseController  
19 -{  
20 - /**  
21 - * @name :用户组列表  
22 - * @return json  
23 - * @author :liyuhang  
24 - * @method  
25 - */  
26 - public function lists(ProjectGroup $projectGroup)  
27 - {  
28 - $lists = $projectGroup->list($this->map,'id',['name','user_list','pid','id']);  
29 - $menu = [];  
30 - foreach ($lists as $k => $v){  
31 - $v = (array)$v;  
32 - if ($v['pid'] == 0) {  
33 - $v['sub'] = _get_child($v['id'], $lists);  
34 - $menu[] = $v;  
35 - }  
36 - }  
37 - $this->response('success',Code::SUCCESS,$menu);  
38 - }  
39 -  
40 - /**  
41 - * @name :详情  
42 - * @return json  
43 - * @author :liyuhang  
44 - * @method  
45 - */  
46 - public function info(GroupLogic $groupLogic){  
47 - $this->request->validate([  
48 - 'id'=>['required', new Ids()],  
49 - ],[  
50 - 'id.required' => 'ID不能为空',  
51 - ]);  
52 - $groupLogic->group_info();  
53 - $this->response('success');  
54 - }  
55 - /**  
56 - * @name:添加用户组获取用户列表  
57 - * @return void  
58 - * @author :liyuhang  
59 - * @method  
60 - */  
61 - public function get_user_lists(GroupLogic $groupLogic){  
62 - $lists = $groupLogic->user_list();  
63 - $this->response('success',Code::SUCCESS,$lists);  
64 - }  
65 - /**  
66 - * @param ProjectGroupRequest $request  
67 - * @param ProjectGroupLogic $logic  
68 - * @name : 添加用户组  
69 - * @return void  
70 - * @author :liyuhang  
71 - * @method  
72 - */  
73 - public function add(ProjectGroupRequest $request,GroupLogic $groupLogic){  
74 - $request->validated();  
75 - $groupLogic->group_add();  
76 - $this->response('success');  
77 - }  
78 -  
79 - /**  
80 - * @param ProjectGroupRequest $request  
81 - * @param ProjectGroupLogic $logic  
82 - * @name :编辑用户组  
83 - * @return void  
84 - * @author :liyuhang  
85 - * @method  
86 - */  
87 - public function edit(ProjectGroupRequest $request,GroupLogic $groupLogic){  
88 - $request->validate([  
89 - 'id'=>['required'],  
90 - ],[  
91 - 'id.required' => 'ID不能为空',  
92 - ]);  
93 - $groupLogic->group_edit();  
94 - $this->response('success');  
95 - }  
96 -  
97 - /**  
98 - * @name :删除用户组  
99 - * @return void  
100 - * @author :liyuhang  
101 - * @method  
102 - */  
103 - public function del(GroupLogic $groupLogic){  
104 - $this->request->validate([  
105 - 'id'=>['required','array'],  
106 - ],[  
107 - 'id.required' => 'ID不能为空',  
108 - 'id.array' => 'ID为数组',  
109 - ]);  
110 - $groupLogic->group_del();  
111 - $this->response('success');  
112 - }  
113 -}  
1 -<?php  
2 -  
3 -namespace App\Http\Controllers\Cside;  
4 -  
5 -use App\Enums\Common\Code;  
6 -use App\Http\Controllers\Controller;  
7 -use Illuminate\Http\JsonResponse;  
8 -use Illuminate\Http\Request;  
9 -use Illuminate\Http\Exceptions\HttpResponseException;  
10 -use Illuminate\Support\Facades\Cache;  
11 -use Illuminate\Support\Facades\Session;  
12 -  
13 -class BaseController extends Controller  
14 -{  
15 - protected $param = [];//所有请求参数  
16 - protected $token = ''; //token  
17 - protected $request = [];//助手函数  
18 - protected $project = [];//当前登录用户详情  
19 - /**  
20 - * 获取所有参数  
21 - */  
22 - public function __construct(Request $request)  
23 - {  
24 - $this->request = $request;  
25 - $this->param = $this->request->all();  
26 - $this->token = $this->request->header('token');  
27 - if(!empty($this->token) && !empty(Cache::get($this->token))){  
28 - $info = Cache::get($this->token);  
29 - $this->user = $info;  
30 - $this->uid = $info['id'];  
31 - }  
32 -  
33 - }  
34 -  
35 -  
36 - /**  
37 - * 成功返回  
38 - * @param array $data  
39 - * @param string $code  
40 - * @param bool $objectData  
41 - * @return JsonResponse  
42 - * @throws \Psr\Container\ContainerExceptionInterface  
43 - * @throws \Psr\Container\NotFoundExceptionInterface  
44 - */  
45 - function success(array $data = [], string $code = Code::SUCCESS, bool $objectData = false): JsonResponse  
46 - {  
47 - if ($objectData) {  
48 - $data = (object)$data;  
49 - }  
50 - $code = Code::fromValue($code);  
51 - $response = [  
52 - 'code' => $code->value,  
53 - 'data' => $data,  
54 - 'msg' => $code->description,  
55 - ];  
56 - return response()->json($response,200);  
57 - }  
58 -}  
1 -<?php  
2 -  
3 -namespace App\Http\Controllers\Cside;  
4 -  
5 -use App\Http\Logic\Cside\InquiryLogic;  
6 -use App\Http\Requests\Cside\InquiryRequest;  
7 -  
8 -/**  
9 - * 精准询盘  
10 - * Class InquiryController  
11 - * @package App\Http\Controllers\Bside  
12 - * @author zbj  
13 - * @date 2023/5/4  
14 - */  
15 -class InquiryController extends BaseController  
16 -{  
17 -  
18 - public function save(InquiryRequest $request, InquiryLogic $logic)  
19 - {  
20 - $data = $logic->save($this->param);  
21 - return $this->success($data);  
22 - }  
23 -}  
@@ -11,7 +11,6 @@ use App\Http\Middleware\Bside\EnableCrossRequestMiddleware; @@ -11,7 +11,6 @@ use App\Http\Middleware\Bside\EnableCrossRequestMiddleware;
11 use App\Http\Middleware\Bside\ParamMiddleware as BsideParamMiddleware; 11 use App\Http\Middleware\Bside\ParamMiddleware as BsideParamMiddleware;
12 use App\Http\Middleware\Aside\LoginAuthMiddleware as AsideLoginAuthMiddleware; 12 use App\Http\Middleware\Aside\LoginAuthMiddleware as AsideLoginAuthMiddleware;
13 use App\Http\Middleware\Bside\LoginAuthMiddleware as BsideLoginAuthMiddleware; 13 use App\Http\Middleware\Bside\LoginAuthMiddleware as BsideLoginAuthMiddleware;
14 -use App\Http\Middleware\Cside\ParamMiddleware as CsideParamMiddleware;  
15 use App\Http\Middleware\PreventRepeatQuitCallMiddleware; 14 use App\Http\Middleware\PreventRepeatQuitCallMiddleware;
16 use Illuminate\Foundation\Http\Kernel as HttpKernel; 15 use Illuminate\Foundation\Http\Kernel as HttpKernel;
17 16
@@ -77,11 +76,6 @@ class Kernel extends HttpKernel @@ -77,11 +76,6 @@ class Kernel extends HttpKernel
77 //允许跨域请求 76 //允许跨域请求
78 EnableCrossRequestMiddleware::class 77 EnableCrossRequestMiddleware::class
79 ], 78 ],
80 - //C端中间件组  
81 - 'cside'=>[  
82 - //参数处理中间件--涉及-参数记录-参数加解密等  
83 - CsideParamMiddleware::class,  
84 - ]  
85 ]; 79 ];
86 80
87 /** 81 /**
1 -<?php  
2 -  
3 -namespace App\Http\Logic\Aside\User;  
4 -  
5 -use App\Http\Logic\Aside\BaseLogic;  
6 -use App\Models\User\ProjectMenu;  
7 -  
8 -class ProjectGroupLogic extends BaseLogic  
9 -{  
10 - public function __construct()  
11 - {  
12 - parent::__construct();  
13 -  
14 - $this->model = new ProjectMenu();  
15 - $this->param = $this->requestAll;  
16 - }  
17 -  
18 - /**  
19 - * @name :详情  
20 - * @return void  
21 - * @author :liyuhang  
22 - * @method  
23 - */  
24 - public function group_info(){  
25 - $info = $this->info($this->param);  
26 - return $this->success($info);  
27 - }  
28 -  
29 - /**  
30 - * @name :添加  
31 - * @return void  
32 - * @author :liyuhang  
33 - * @method  
34 - */  
35 - public function group_add(){  
36 - //查看当前用户组是否存在  
37 - $this->model->read(['name'=>$this->param['name'],'create_id'=>$this->user['id']]);  
38 - $rs = $this->model->add($this->param);  
39 - if($rs === false){  
40 - $this->fail('error');  
41 - }  
42 - return $this->success();  
43 - }  
44 -  
45 - /**  
46 - * @name :编辑  
47 - * @return void  
48 - * @author :liyuhang  
49 - * @method  
50 - */  
51 - public function group_edit(){  
52 - //查看当前用户组是否存在  
53 - $rs = $this->model->read(['name'=>$this->param['name'],'create_id'=>$this->user['id']]);  
54 - if($rs === false){  
55 - $this->fail('error');  
56 - }  
57 - return $this->success();  
58 - }  
59 -  
60 - /**  
61 - * @name :删除  
62 - * @return void  
63 - * @author :liyuhang  
64 - * @method  
65 - */  
66 - public function group_del(){  
67 - $this->param['id'] = ['in',$this->param['id']];  
68 - $rs = $this->model->del($this->param);  
69 - if($rs === false){  
70 - $this->fail('error');  
71 - }  
72 - return $this->success();  
73 - }  
74 -}  
@@ -64,7 +64,7 @@ class AyrReleaseLogic extends BaseLogic @@ -64,7 +64,7 @@ class AyrReleaseLogic extends BaseLogic
64 $arr[] = $v1['ayr_url']; 64 $arr[] = $v1['ayr_url'];
65 } 65 }
66 }else{ 66 }else{
67 - $arr[] = url('/b/file_hash/' . $v.rand(10000,99999).'mp4');; 67 + $arr[] = url('/b/file_hash/' . $v.rand(10000,99999).'mp4');
68 } 68 }
69 } 69 }
70 return $this->success($arr); 70 return $this->success($arr);
@@ -3,7 +3,10 @@ @@ -3,7 +3,10 @@
3 namespace App\Http\Logic\Bside; 3 namespace App\Http\Logic\Bside;
4 4
5 use App\Helper\Arr; 5 use App\Helper\Arr;
6 -use App\Models\Inquiry; 6 +use App\Helper\FormGlobalsoApi;
  7 +use App\Helper\Translate;
  8 +use App\Http\Logic\Aside\Project\ProjectLogic;
  9 +use App\Models\InquirySet;
7 10
8 /** 11 /**
9 * Class InquiryLogic 12 * Class InquiryLogic
@@ -11,25 +14,119 @@ use App\Models\Inquiry; @@ -11,25 +14,119 @@ use App\Models\Inquiry;
11 * @author zbj 14 * @author zbj
12 * @date 2023/5/4 15 * @date 2023/5/4
13 */ 16 */
14 -class InquiryLogic extends BaseLogic 17 +class InquiryLogic extends BaseLogic
15 { 18 {
  19 + protected $form_globalso_api;
  20 +
16 public function __construct() 21 public function __construct()
17 { 22 {
18 parent::__construct(); 23 parent::__construct();
19 24
20 - $this->model = new Inquiry(); 25 + $this->form_globalso_api = new FormGlobalsoApi();
  26 + }
  27 +
  28 + public function getApiList($export = false)
  29 + {
  30 + $page_size = $export ? 1000 : 20;
  31 + $search = $this->request['search'] ?: '';
  32 + $page = $this->request['page'] ?: 1;
  33 + $project = (new ProjectLogic())->getInfo($this->user['project_id']);
  34 + $domain = $project['deploy_optimize']['domain'] ?: '';
  35 + $list = $this->form_globalso_api->getInquiryList($domain, $search, $page, $page_size);
  36 + //处理格式 免得前端又改
  37 + $data = [
  38 + "list" => [],
  39 + "total" => 0,
  40 + "page" => $page,
  41 + "total_page" => 1,
  42 + "size" => $page_size
  43 + ];
  44 + if (!empty($list['status']) && $list['status'] == 200) {
  45 + foreach ($list['data']['data'] as $item) {
  46 + $data['list'][] = $item;
  47 + }
  48 + $data['total'] = $list['data']['total'];
  49 + $data['total_page'] = $list['data']['last_page'];
  50 + }
  51 + return $this->success($data);
21 } 52 }
22 53
23 public function getInfo($id) 54 public function getInfo($id)
24 { 55 {
25 - $info = $this->getCacheInfo($id);  
26 - if(!$info){  
27 - $this->fail('数据不存在或者已经删除'); 56 + $project = (new ProjectLogic())->getInfo($this->user['project_id']);
  57 + $domain = $project['deploy_optimize']['domain'] ?: '';
  58 + //修改状态为已读
  59 + if($this->request['read_status']){
  60 + $this->form_globalso_api->saveInquiryRead($domain, $id);
  61 + }
  62 + //翻译
  63 + $trans_message = '';
  64 + if($this->request['message']){
  65 + $trans_message = Translate::tran($this->request['message'], 'zh');
  66 + }
  67 + return $this->success(['trans_message' => $trans_message]);
  68 + }
  69 +
  70 + public function delete($ids, $map = [])
  71 + {
  72 + $project = (new ProjectLogic())->getInfo($this->user['project_id']);
  73 + $domain = $project['deploy_optimize']['domain'] ?: '';
  74 + $ids = array_filter(Arr::splitFilterToArray($ids), 'intval');
  75 + if(!$ids){
  76 + $this->fail('ID不能为空');
  77 + }
  78 + $this->form_globalso_api->delInquiry($domain, $ids);
  79 + return $this->success();
  80 + }
  81 +
  82 + /**
  83 + * 读取设置
  84 + * @return array
  85 + * @author zbj
  86 + * @date 2023/5/17
  87 + */
  88 + public function getSet()
  89 + {
  90 + $set = InquirySet::where('project_id', $this->user['project_id'])->first();
  91 + if ($set) {
  92 + return $this->success(Arr::twoKeepKeys($set->toArray(), ['emails', 'phones']));
  93 + } else {
  94 + return $this->success(['emails' => '', 'phones' => '']);
  95 + }
  96 + }
  97 +
  98 + /**
  99 + * 保存设置
  100 + * @author zbj
  101 + * @date 2023/5/17
  102 + */
  103 + public function saveSet()
  104 + {
  105 + $project = (new ProjectLogic())->getInfo($this->user['project_id']);
  106 +
  107 + //同步到接口
  108 + $domain = parse_url($project['deploy_optimize']['domain'])['host'] ?? ['path'];
  109 + $emails = Arr::arrToSet($this->request['emails'], 'trim');
  110 + $phones = Arr::arrToSet($this->request['phones'], 'trim');
  111 +
  112 + $res = $this->form_globalso_api->setInquiry($domain, $emails, $phones);
  113 +
  114 + if (!$res) {
  115 + $this->fail('保存失败');
28 } 116 }
29 - //标记已读  
30 - if($info->status == Inquiry::STATUS_UNREAD){  
31 - parent::save(['id' => $info['id'], 'status' => Inquiry::STATUS_READ]); 117 + if ($res['status'] != 200) {
  118 + $this->fail($res['message'] ?? '保存失败');
32 } 119 }
33 - return $this->success($info->toArray()); 120 + //保存
  121 + $set = InquirySet::where('project_id', $this->user['project_id'])->first();
  122 + if (!$set) {
  123 + $set = new InquirySet();
  124 + }
  125 + $set->project_id = $this->user['project_id'];
  126 + $set->emails = $emails;
  127 + $set->phones = $phones;
  128 + $set->save();
34 } 129 }
  130 +
  131 +
35 } 132 }
@@ -4,7 +4,7 @@ namespace App\Http\Logic\Bside\User; @@ -4,7 +4,7 @@ namespace App\Http\Logic\Bside\User;
4 4
5 use App\Helper\Arr; 5 use App\Helper\Arr;
6 use App\Http\Logic\Bside\BaseLogic; 6 use App\Http\Logic\Bside\BaseLogic;
7 -use App\Models\ProjectDept; 7 +use App\Models\User\ProjectDept;
8 8
9 /** 9 /**
10 * Class DeptLogic 10 * Class DeptLogic
@@ -42,4 +42,17 @@ class DeptUserLogic extends BaseLogic @@ -42,4 +42,17 @@ class DeptUserLogic extends BaseLogic
42 $list = $userModel->list($param,'id',['id','name','email','mobile','created_at']); 42 $list = $userModel->list($param,'id',['id','name','email','mobile','created_at']);
43 return $this->success($list); 43 return $this->success($list);
44 } 44 }
  45 +<<<<<<< HEAD
  46 +=======
  47 +
  48 + /**
  49 + * @name :dept_user_add
  50 + * @author :lyh
  51 + * @method :post
  52 + * @time :2023/5/17 17:54
  53 + */
  54 + public function dept_user_add(){
  55 +
  56 + }
  57 +>>>>>>> 8a42c22c01d5a3d48150b079338b5db1a01229cf
45 } 58 }
@@ -4,6 +4,8 @@ namespace App\Http\Logic\Bside\User; @@ -4,6 +4,8 @@ namespace App\Http\Logic\Bside\User;
4 4
5 use App\Http\Logic\Bside\BaseLogic; 5 use App\Http\Logic\Bside\BaseLogic;
6 use App\Models\User\ProjectGroup; 6 use App\Models\User\ProjectGroup;
  7 +use App\Models\User\User as UserModel;
  8 +use Illuminate\Support\Facades\DB;
7 9
8 class GroupLogic extends BaseLogic 10 class GroupLogic extends BaseLogic
9 { 11 {
@@ -15,52 +17,86 @@ class GroupLogic extends BaseLogic @@ -15,52 +17,86 @@ class GroupLogic extends BaseLogic
15 $this->param = $this->requestAll; 17 $this->param = $this->requestAll;
16 } 18 }
17 /** 19 /**
18 - * @name :添加 20 + * @name :添加用户组
19 * @return void 21 * @return void
20 * @author :liyuhang 22 * @author :liyuhang
21 * @method 23 * @method
22 */ 24 */
23 public function group_add(){ 25 public function group_add(){
24 $this->param['project_id'] = $this->user['project_id']; 26 $this->param['project_id'] = $this->user['project_id'];
25 - $this->param['admin_id'] = $this->user['admin_id'];  
26 - $this->param['create_id'] = $this->user['create_id'];  
27 - $this->param['operator_id'] = $this->user['operator_id'];  
28 - $this->param['user_list'] = ','.trim($this->param['user_list'],',').','; 27 + $this->param['admin_id'] = $this->user['id'];
  28 + $this->param['create_id'] = $this->user['id'];
  29 + $this->param['operator_id'] = $this->user['id'];
29 $rs = $this->model->add($this->param); 30 $rs = $this->model->add($this->param);
30 if($rs === false){ 31 if($rs === false){
31 $this->fail('error'); 32 $this->fail('error');
32 } 33 }
33 - if(isset($this->param['pid']) && !empty($this->param['pid'])){  
34 - $this->add_update_parent($this->param);  
35 - }  
36 return $this->success(); 34 return $this->success();
37 } 35 }
38 36
39 /** 37 /**
  38 + * @name :(添加成员)group_add_user
  39 + * @author :lyh
  40 + * @method :post
  41 + * @time :2023/5/17 15:58
  42 + */
  43 + public function group_add_user(){
  44 + $info = $this->model->read(['id'=>$this->param['id']]);
  45 + //组装数据
  46 + $str = ltrim($info['user_list'],',').$this->param['user_list'];
  47 + $arr = array_unique(explode(',',$str));
  48 + sort($arr);
  49 + $str = ','.implode(',',$arr).',';
  50 + DB::beginTransaction();
  51 + try {
  52 + $this->model->edit(['user_list'=>$str],['id'=>$this->param['id']]);
  53 + //更新父类
  54 + $this->update_parent($this->param,$info);
  55 + DB::commit();
  56 + }catch (\Exception $e){
  57 + DB::rollBack();
  58 + $this->fail('添加成员失败');
  59 + }
  60 + return $this->success();
  61 + }
  62 + /**
40 * @name :编辑 63 * @name :编辑
41 * @return void 64 * @return void
42 * @author :liyuhang 65 * @author :liyuhang
43 * @method 66 * @method
44 */ 67 */
45 public function group_edit(){ 68 public function group_edit(){
46 - $this->param['user_list'] = ','.trim($this->param['user_list'],',').',';  
47 $rs = $this->edit($this->param,['id'=>$this->param['id']]); 69 $rs = $this->edit($this->param,['id'=>$this->param['id']]);
48 if($rs === false){ 70 if($rs === false){
49 $this->fail('error'); 71 $this->fail('error');
50 } 72 }
51 - //更新父类  
52 - $this->update_parent($this->param,$this->param['id']);  
53 return $this->success(); 73 return $this->success();
54 } 74 }
55 75
56 /** 76 /**
  77 + * @name :(获取成员列表)user_list
  78 + * @author :lyh
  79 + * @method :post
  80 + * @time :2023/5/17 14:51
  81 + */
  82 + public function user_list($data = [],$order = 'id'){
  83 + unset($this->param['id']);
  84 + $userModel = new UserModel();
  85 + $data = array_merge($data,$this->param);
  86 + $lists = $userModel->list($data,$order,['id','name','mobile','created_at']);
  87 + return $this->success($lists);
  88 + }
  89 + /**
57 * @name :详情 90 * @name :详情
58 * @return void 91 * @return void
59 * @author :liyuhang 92 * @author :liyuhang
60 * @method 93 * @method
61 */ 94 */
62 - public function group_info(){  
63 - $info = $this->info($this->param); 95 + public function group_info($param = []){
  96 + if(empty($param)){
  97 + $param = $this->param;
  98 + }
  99 + $info = $this->model->read($this->param);
64 return $this->success($info); 100 return $this->success($info);
65 } 101 }
66 102
@@ -76,7 +112,7 @@ class GroupLogic extends BaseLogic @@ -76,7 +112,7 @@ class GroupLogic extends BaseLogic
76 if($info !== false){ 112 if($info !== false){
77 $this->fail('当前删除组织拥有下级组织,不允许删除'); 113 $this->fail('当前删除组织拥有下级组织,不允许删除');
78 } 114 }
79 - $rs = $this->model->del($this->param); 115 + $rs = $this->del($this->param);
80 if($rs === false){ 116 if($rs === false){
81 $this->fail('error'); 117 $this->fail('error');
82 } 118 }
@@ -89,26 +125,51 @@ class GroupLogic extends BaseLogic @@ -89,26 +125,51 @@ class GroupLogic extends BaseLogic
89 * @method :post 125 * @method :post
90 * @time :2023/5/17 9:22 126 * @time :2023/5/17 9:22
91 */ 127 */
92 - public function update_parent($param,$id = ''){  
93 - if(!empty($id)){  
94 - $param = $this->model->read(['id'=>$id]);  
95 - } 128 + public function update_parent($param,$info){
96 //查询当前组是否拥有父类 129 //查询当前组是否拥有父类
97 - if($param['pid'] != 0){  
98 - $parent_info = $this->model->read(['id'=>$param['pid']]); 130 + if($info['pid'] != 0){
  131 + $parent_info = $this->model->read(['id'=>$info['pid']]);
99 //把添加成员合并到上级 132 //把添加成员合并到上级
100 - $str = trim($param['user_list'].$parent_info['user_list'],',');  
101 - $mergedString = ','.implode(',', array_unique(explode(',', $str))).','; 133 + $str = trim(trim($param['user_list'],',').$parent_info['user_list'],',');
  134 + $arr = array_unique(explode(',', $str));
  135 + sort($arr);
  136 + $mergedString = ','.implode(',', $arr).',';
102 $rs = $this->model->edit(['user_list'=>$mergedString],['id'=>$parent_info['id']]); 137 $rs = $this->model->edit(['user_list'=>$mergedString],['id'=>$parent_info['id']]);
103 if($rs === false){ 138 if($rs === false){
104 $this->fail('更新父级失败'); 139 $this->fail('更新父级失败');
105 } 140 }
106 //查看当前父级是否还拥有父级 141 //查看当前父级是否还拥有父级
107 if($parent_info['pid'] != 0){ 142 if($parent_info['pid'] != 0){
108 - $rs = $this->update_parent($parent_info); 143 + return $this->update_parent($param,$parent_info);
109 } 144 }
110 } 145 }
111 - return $this->success($rs); 146 + return $this->success();
112 } 147 }
113 148
  149 + /**
  150 + * @name :(更新子类,同时清空子集成员)edit_son
  151 + * @author :lyh
  152 + * @method :post
  153 + * @time :2023/5/17 13:52
  154 + */
  155 + public function update_son($param,$id){
  156 + //当前数据详情
  157 + $info = $this->model->read(['id'=>$id]);
  158 + //子集详情
  159 + $son_list = $this->model->list(['pid'=>$info['id']],'id');
  160 + if(!empty($son_list)){
  161 + //循环查询
  162 + foreach ($son_list as $k => $v){
  163 + $son_data = explode(',',trim($v['user_list'],','));
  164 + $son_str = '';
  165 + foreach ($son_data as $v1){
  166 + if(strpos($param['user_list'],','.$v1.',') > -1){
  167 + $son_str .= $v1.',';
  168 + }
  169 + }
  170 + $this->model->edit(['user_list'=>','.$son_str],['id'=>$v['id']]);
  171 + }
  172 + }
  173 + return true;
  174 + }
114 } 175 }
1 -<?php  
2 -  
3 -namespace App\Http\Logic\Cside;  
4 -  
5 -  
6 -use App\Enums\Common\Common;  
7 -use App\Exceptions\BsideGlobalException;  
8 -use App\Http\Logic\Logic;  
9 -  
10 -/**  
11 - * @notes: 逻辑层基类 控制器调用 统一返回 统一抛出异常  
12 - */  
13 -class BaseLogic extends Logic  
14 -{  
15 -  
16 - protected $requestAll;  
17 -  
18 - protected $param;  
19 -  
20 - protected $request;  
21 -  
22 - protected $project;  
23 -  
24 - protected $side = Common::C;  
25 -  
26 - public function __construct()  
27 - {  
28 - $this->request = request();  
29 - $this->requestAll = request()->all();  
30 - $this->project = $this->request->get('project');  
31 - }  
32 -  
33 -  
34 - /**  
35 - * 列表  
36 - * @param array $map  
37 - * @param array $sort  
38 - * @param array $columns  
39 - * @param int $limit  
40 - * @return array  
41 - * @author zbj  
42 - * @date 2023/4/13  
43 - */  
44 - public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20)  
45 - {  
46 - $map[] = ['project_id' => $this->project['id']];  
47 - return parent::getList($map, $sort, $columns, $limit);  
48 - }  
49 -  
50 - /**  
51 - * @param $id  
52 - * @return mixed  
53 - * @author zbj  
54 - * @date 2023/4/15  
55 - */  
56 - public function getCacheInfo($id)  
57 - {  
58 - $info = parent::getCacheInfo($id);  
59 - if ($info && $info['project_id'] != $this->project['id']) {  
60 - $info = null;  
61 - }  
62 - return $info;  
63 - }  
64 -  
65 - /**  
66 - * 保存  
67 - * @param $param  
68 - * @return array  
69 - * @throws BsideGlobalException  
70 - * @author zbj  
71 - * @date 2023/4/13  
72 - */  
73 - public function save($param)  
74 - {  
75 - $param['project_id'] = $this->project['id'];  
76 - return parent::save($param);  
77 - }  
78 -  
79 - /**  
80 - * 批量删除  
81 - * @param $ids  
82 - * @param array $map  
83 - * @return array  
84 - * @author zbj  
85 - * @date 2023/4/13  
86 - */  
87 - public function delete($ids, $map = [])  
88 - {  
89 - $map[] = ['project_id' => $this->project['id']];  
90 - return parent::delete($ids, $map);  
91 - }  
92 -  
93 -}  
1 -<?php  
2 -  
3 -namespace App\Http\Logic\Cside;  
4 -  
5 -use App\Helper\Arr;  
6 -use App\Models\Inquiry;  
7 -  
8 -/**  
9 - * Class InquiryLogic  
10 - * @package App\Http\Logic\Bside  
11 - * @author zbj  
12 - * @date 2023/5/4  
13 - */  
14 -class InquiryLogic extends BaseLogic  
15 -{  
16 - public function __construct()  
17 - {  
18 - parent::__construct();  
19 -  
20 - $this->model = new Inquiry();  
21 - }  
22 -  
23 - public function save($param)  
24 - {  
25 - $param['ip_info'] = Arr::s2a($param['ip_info']);  
26 - $param['ip'] = $param['ip_info']['ip'] ?? '';  
27 - $param['ip_country'] = $param['ip_info']['country'] ?? '';  
28 - return parent::save($param);  
29 - }  
30 -  
31 -}  
@@ -4,7 +4,6 @@ namespace App\Http\Logic; @@ -4,7 +4,6 @@ namespace App\Http\Logic;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
6 use App\Enums\Common\Common; 6 use App\Enums\Common\Common;
7 -use App\Exceptions\CsideGlobalException;  
8 use \App\Helper\Common as CommonHelper; 7 use \App\Helper\Common as CommonHelper;
9 use App\Exceptions\AsideGlobalException; 8 use App\Exceptions\AsideGlobalException;
10 use App\Exceptions\BsideGlobalException; 9 use App\Exceptions\BsideGlobalException;
@@ -46,9 +45,6 @@ class Logic @@ -46,9 +45,6 @@ class Logic
46 if((request()->path()[0]) == Common::B){ 45 if((request()->path()[0]) == Common::B){
47 throw new BsideGlobalException($code, $message); 46 throw new BsideGlobalException($code, $message);
48 } 47 }
49 - if((request()->path()[0]) == Common::C){  
50 - throw new CsideGlobalException($code, $message);  
51 - }  
52 throw new AsideGlobalException($code, $message); 48 throw new AsideGlobalException($code, $message);
53 } 49 }
54 50
1 -<?php  
2 -  
3 -namespace App\Http\Middleware\Cside;  
4 -  
5 -use App\Enums\Common\Code;  
6 -use App\Models\Project\Project;  
7 -use App\Services\ProjectServer;  
8 -use Closure;  
9 -use Illuminate\Http\Request;  
10 -  
11 -class ParamMiddleware  
12 -{  
13 - protected $param = [];  
14 -  
15 - protected $project = [];  
16 -  
17 - /**  
18 - * Handle an incoming request.  
19 - *  
20 - * @param \Illuminate\Http\Request $request  
21 - * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next  
22 - * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse  
23 - */  
24 - public function handle(Request $request, Closure $next)  
25 - {  
26 - $this->param = $request->all();  
27 - $domain = $request->header('domain');  
28 - if(!isset($domain) || empty($domain)){  
29 - return response(['code'=>Code::USER_ERROR,'msg'=>'非法请求']);  
30 - }  
31 - $project = Project::getProjectByDomain($domain);  
32 - if(empty($project)){  
33 - return response(['code'=>Code::USER_ERROR,'msg'=>'非法请求']);  
34 - }  
35 - // 设置数据信息  
36 -// $project = ProjectServer::useProject($project['id']);  
37 -// if($project){  
38 -// return response(['code'=>Code::USER_ERROR,'msg'=>'数据库未配置']);  
39 -// }  
40 - $request->attributes->add(['project' => $project]);  
41 - return $next($request);  
42 - }  
43 -}  
1 -<?php  
2 -  
3 -namespace App\Http\Requests\Cside;  
4 -  
5 -use Illuminate\Foundation\Http\FormRequest;  
6 -  
7 -/**  
8 - * Class InquiryRequest  
9 - * @package App\Http\Requests\Cside  
10 - * @author zbj  
11 - * @date 2023/5/4  
12 - */  
13 -class InquiryRequest extends FormRequest  
14 -{  
15 - /**  
16 - * Determine if the user is authorized to make this request.  
17 - *  
18 - * @return bool  
19 - */  
20 - public function authorize()  
21 - {  
22 - return true;  
23 - }  
24 -  
25 - /**  
26 - * Get the validation rules that apply to the request.  
27 - *  
28 - * @return array  
29 - */  
30 - public function rules()  
31 - {  
32 - return [  
33 - 'name' => 'required|max:200',  
34 - 'email' => 'required|email|max:200',  
35 - 'phone' => 'max:200',  
36 - 'content' => 'required',  
37 - ];  
38 - }  
39 -  
40 - public function messages()  
41 - {  
42 - return [];  
43 - }  
44 -  
45 -}  
@@ -187,7 +187,7 @@ class Base extends Model @@ -187,7 +187,7 @@ class Base extends Model
187 // in查询 ['id'=>['in',[1,2,3]]] 187 // in查询 ['id'=>['in',[1,2,3]]]
188 $query->orWhere($k, $v[1]); 188 $query->orWhere($k, $v[1]);
189 break; 189 break;
190 - case 'no in': 190 + case 'not in':
191 // in查询 ['id'=>['not in',[1,2,3]]] 191 // in查询 ['id'=>['not in',[1,2,3]]]
192 $query->whereNotIn($k, $v[1]); 192 $query->whereNotIn($k, $v[1]);
193 break; 193 break;
1 -<?php  
2 -  
3 -namespace App\Models;  
4 -  
5 -use App\Helper\Arr;  
6 -use Illuminate\Database\Eloquent\SoftDeletes;  
7 -  
8 -/**  
9 - * Class Inquiry  
10 - * @package App\Models  
11 - * @author zbj  
12 - * @date 2023/5/4  
13 - */  
14 -class Inquiry extends Base  
15 -{  
16 - use SoftDeletes;  
17 -  
18 - //设置关联表名  
19 - protected $table = 'gl_inquiry';  
20 -  
21 - const STATUS_UNREAD = 0;  
22 - const STATUS_READ = 1;  
23 -  
24 - public function setIpInfoAttribute($value){  
25 - $this->attributes['ip_info'] = Arr::a2s($value);  
26 - }  
27 -  
28 - public function getIpInfoAttribute($value){  
29 - return Arr::s2a($value);  
30 - }  
31 -}  
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +
  6 +/**
  7 + * Class InquirySet
  8 + * @package App\Models
  9 + * @author zbj
  10 + * @date 2023/5/17
  11 + */
  12 +class InquirySet extends Base
  13 +{
  14 +
  15 + //设置关联表名
  16 + protected $table = 'gl_inquiry_set';
  17 +
  18 +
  19 +}
1 -<?php  
2 -  
3 -namespace App\Models;  
4 -  
5 -use Illuminate\Database\Eloquent\SoftDeletes;  
6 -  
7 -class ProjectDept extends Base  
8 -{  
9 - use SoftDeletes;  
10 -  
11 - //设置关联表名  
12 - protected $table = 'gl_project_dept';  
13 -  
14 -}  
1 -<?php  
2 -  
3 -namespace App\Models\User;  
4 -  
5 -use App\Models\Base;  
6 -  
7 -class ProjectGroup extends Base  
8 -{  
9 - //设置关联表名  
10 - protected $table = 'gl_project_group';  
11 - //自动维护create_at创建时间 updated_at修改时间  
12 - public $timestamps = true;  
13 -}  
@@ -40,7 +40,6 @@ class RouteServiceProvider extends ServiceProvider @@ -40,7 +40,6 @@ class RouteServiceProvider extends ServiceProvider
40 //预定义两个端的API路由 40 //预定义两个端的API路由
41 $this->mapAsideRoute(); 41 $this->mapAsideRoute();
42 $this->mapBsideRoute(); 42 $this->mapBsideRoute();
43 - $this->mapCsideRoute();  
44 43
45 // 暂时无用 44 // 暂时无用
46 $this->routes(function () { 45 $this->routes(function () {
@@ -75,16 +74,6 @@ class RouteServiceProvider extends ServiceProvider @@ -75,16 +74,6 @@ class RouteServiceProvider extends ServiceProvider
75 ->namespace($this->namespace . '\Bside') 74 ->namespace($this->namespace . '\Bside')
76 ->group(base_path('routes/bside.php')); 75 ->group(base_path('routes/bside.php'));
77 } 76 }
78 - /**  
79 - *C端API路由  
80 - * @return void  
81 - */  
82 - protected function mapCsideRoute(){  
83 - Route::middleware('cside')  
84 - ->prefix('c')  
85 - ->namespace($this->namespace . '\Cside')  
86 - ->group(base_path('routes/cside.php'));  
87 - }  
88 77
89 /** 78 /**
90 * Configure the rate limiters for the application. 79 * Configure the rate limiters for the application.
@@ -60,12 +60,6 @@ return [ @@ -60,12 +60,6 @@ return [
60 'via' => \App\Factory\LogFormatterFactory::class, 60 'via' => \App\Factory\LogFormatterFactory::class,
61 'prefix' => 'bside', 61 'prefix' => 'bside',
62 ], 62 ],
63 - //自定义B端错误日志  
64 - 'cside' => [  
65 - 'driver' => 'custom',  
66 - 'via' => \App\Factory\LogFormatterFactory::class,  
67 - 'prefix' => 'cside',  
68 - ],  
69 63
70 'stack' => [ 64 'stack' => [
71 'driver' => 'stack', 65 'driver' => 'stack',
@@ -42,16 +42,6 @@ Route::middleware(['bloginauth'])->group(function () { @@ -42,16 +42,6 @@ Route::middleware(['bloginauth'])->group(function () {
42 Route::any('/get_user_list', [\App\Http\Controllers\Bside\User\ProjectRoleController::class, 'get_user_list'])->name('project_role_get_user_list'); 42 Route::any('/get_user_list', [\App\Http\Controllers\Bside\User\ProjectRoleController::class, 'get_user_list'])->name('project_role_get_user_list');
43 }); 43 });
44 44
45 - //group相关路  
46 - Route::prefix('group')->group(function () {  
47 - Route::any('/', [\App\Http\Controllers\Bside\User\ProjectGroupController::class, 'lists'])->name('project_group_lists');  
48 - Route::any('/add', [\App\Http\Controllers\Bside\User\ProjectGroupController::class, 'add'])->name('project_group_add');  
49 - Route::any('/edit', [\App\Http\Controllers\Bside\User\ProjectGroupController::class, 'edit'])->name('project_group_edit');  
50 - Route::any('/info', [\App\Http\Controllers\Bside\User\ProjectGroupController::class, 'info'])->name('project_group_info');  
51 - Route::any('/del', [\App\Http\Controllers\Bside\User\ProjectGroupController::class, 'del'])->name('project_group_del');  
52 - Route::any('/get_user_lists', [\App\Http\Controllers\Bside\User\ProjectGroupController::class, 'get_user_lists'])->name('project_group_get_user_lists');  
53 - });  
54 -  
55 //新闻相关路由 45 //新闻相关路由
56 Route::prefix('news')->group(function () { 46 Route::prefix('news')->group(function () {
57 //分类 47 //分类
@@ -182,6 +172,16 @@ Route::middleware(['bloginauth'])->group(function () { @@ -182,6 +172,16 @@ Route::middleware(['bloginauth'])->group(function () {
182 Route::get('/info', [\App\Http\Controllers\Bside\User\DeptController::class, 'info'])->name('dept_info'); 172 Route::get('/info', [\App\Http\Controllers\Bside\User\DeptController::class, 'info'])->name('dept_info');
183 Route::post('/save', [\App\Http\Controllers\Bside\User\DeptController::class, 'save'])->name('dept_save'); 173 Route::post('/save', [\App\Http\Controllers\Bside\User\DeptController::class, 'save'])->name('dept_save');
184 Route::any('/delete', [\App\Http\Controllers\Bside\User\DeptController::class, 'delete'])->name('dept_delete'); 174 Route::any('/delete', [\App\Http\Controllers\Bside\User\DeptController::class, 'delete'])->name('dept_delete');
  175 + //成员管理
  176 + //组织架构
  177 + Route::prefix('user')->group(function () {
  178 + Route::any('/', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'lists'])->name('dept_user');
  179 + Route::any('/get_user_list', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'get_user_list'])->name('dept_user_get_user_list');
  180 + Route::any('/info', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'info'])->name('dept_user_info');
  181 + Route::post('/save', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'save'])->name('dept_user_save');
  182 + Route::any('/delete', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'delete'])->name('dept_user_delete');
  183 +
  184 + });
185 }); 185 });
186 186
187 //文件操作 187 //文件操作
@@ -199,6 +199,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -199,6 +199,7 @@ Route::middleware(['bloginauth'])->group(function () {
199 //精准询盘 199 //精准询盘
200 Route::prefix('inquiry')->group(function () { 200 Route::prefix('inquiry')->group(function () {
201 Route::get('/', [\App\Http\Controllers\Bside\InquiryController::class, 'index'])->name('inquiry'); 201 Route::get('/', [\App\Http\Controllers\Bside\InquiryController::class, 'index'])->name('inquiry');
  202 + Route::any('/set', [\App\Http\Controllers\Bside\InquiryController::class, 'set'])->name('inquiry_set');
202 Route::get('/info', [\App\Http\Controllers\Bside\InquiryController::class, 'info'])->name('inquiry_info'); 203 Route::get('/info', [\App\Http\Controllers\Bside\InquiryController::class, 'info'])->name('inquiry_info');
203 Route::any('/delete', [\App\Http\Controllers\Bside\InquiryController::class, 'delete'])->name('inquiry_delete'); 204 Route::any('/delete', [\App\Http\Controllers\Bside\InquiryController::class, 'delete'])->name('inquiry_delete');
204 Route::any('/export', [\App\Http\Controllers\Bside\InquiryController::class, 'export'])->name('inquiry_export'); 205 Route::any('/export', [\App\Http\Controllers\Bside\InquiryController::class, 'export'])->name('inquiry_export');
1 -<?php  
2 -/**  
3 - * C端用户路由文件  
4 - */  
5 -  
6 -use Illuminate\Support\Facades\Route;  
7 -  
8 -//必须登录验证的路由组  
9 -Route::middleware([])->group(function () {  
10 -  
11 -//添加询盘信息  
12 - Route::post('/inquiry/save', [\App\Http\Controllers\Cside\InquiryController::class, 'save'])->name('inquiry_save');  
13 -});