作者 zhl

Merge remote-tracking branch 'origin/master' into zhl

@@ -100,9 +100,11 @@ class UpdateKeyword extends Command @@ -100,9 +100,11 @@ class UpdateKeyword extends Command
100 }else{ 100 }else{
101 $randomNumber = $text[$key] ?? rand(0, $number - 1); 101 $randomNumber = $text[$key] ?? rand(0, $number - 1);
102 } 102 }
  103 + if(isset($text[$randomNumber])){
103 $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]); 104 $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]);
104 } 105 }
105 } 106 }
  107 + }
106 //按给定的数量更新 108 //按给定的数量更新
107 if(!empty($updateObject['number']) && ($updateObject['number'] != 0)){ 109 if(!empty($updateObject['number']) && ($updateObject['number'] != 0)){
108 $keywordIdArr = $keywordModel->where("status",1)->inRandomOrder()->take($updateObject['number'])->pluck('id')->toArray(); 110 $keywordIdArr = $keywordModel->where("status",1)->inRandomOrder()->take($updateObject['number'])->pluck('id')->toArray();
@@ -112,10 +114,12 @@ class UpdateKeyword extends Command @@ -112,10 +114,12 @@ class UpdateKeyword extends Command
112 }else{ 114 }else{
113 $randomNumber = $text[$key] ?? rand(0, $number - 1); 115 $randomNumber = $text[$key] ?? rand(0, $number - 1);
114 } 116 }
  117 + if(isset($text[$randomNumber])){
115 $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]); 118 $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]);
116 } 119 }
117 } 120 }
118 } 121 }
  122 + }
119 return true; 123 return true;
120 } 124 }
121 125
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :GeoConfirmController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/10/25 11:35
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Geo;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Http\Logic\Aside\Geo\GeoConfirmLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +/**
  18 + * @remark :用户确认信息表
  19 + * @name :GeoConfirmController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/10/25 11:37
  23 + */
  24 +class GeoConfirmController extends BaseController
  25 +{
  26 + public function __construct(){
  27 + parent::__construct();
  28 + $this->logic = new GeoConfirmLogic();
  29 + }
  30 +
  31 + /**
  32 + * 保存确认数据, 并推送微信群
  33 + * @param Request $request
  34 + * @throws \App\Exceptions\AsideGlobalException
  35 + */
  36 + public function saveConfirmContent()
  37 + {
  38 + $this->request->validate([
  39 + 'project_id' => 'required',
  40 + 'type' => 'required|integer',
  41 + 'content' => 'required',
  42 + 'max_num' => 'required',
  43 + ], [
  44 + 'project_id.required' => '项目ID不能为空',
  45 + 'type.required' => '确定数据类型不能为空',
  46 + 'type.integer' => '确定数据类型不正确',
  47 + 'content.required' => '确定数据不能为空',
  48 + 'max_num.required' => '最大确认数量不能为空',
  49 + ]);
  50 + $data = $this->logic->saveConfirmContent($this->param);
  51 + $this->response('success', Code::SUCCESS, $data);
  52 + }
  53 +}
@@ -9,6 +9,7 @@ namespace App\Http\Controllers\Aside\Geo; @@ -9,6 +9,7 @@ namespace App\Http\Controllers\Aside\Geo;
9 9
10 use App\Enums\Common\Code; 10 use App\Enums\Common\Code;
11 use App\Http\Controllers\Aside\BaseController; 11 use App\Http\Controllers\Aside\BaseController;
  12 +use App\Http\Logic\Aside\Geo\GeoLogic;
12 use App\Models\Geo\GeoConf; 13 use App\Models\Geo\GeoConf;
13 use App\Models\Geo\GeoConfirm; 14 use App\Models\Geo\GeoConfirm;
14 use App\Models\Manage\ManageHr; 15 use App\Models\Manage\ManageHr;
@@ -23,6 +24,11 @@ use Illuminate\Http\Request; @@ -23,6 +24,11 @@ use Illuminate\Http\Request;
23 */ 24 */
24 class GeoController extends BaseController 25 class GeoController extends BaseController
25 { 26 {
  27 + public function __construct(){
  28 + parent::__construct();
  29 + $this->logic = new GeoLogic();
  30 + }
  31 +
26 /** 32 /**
27 * 获取GEO相关配置 33 * 获取GEO相关配置
28 * @param Request $request 34 * @param Request $request
@@ -34,36 +40,8 @@ class GeoController extends BaseController @@ -34,36 +40,8 @@ class GeoController extends BaseController
34 ], [ 40 ], [
35 'project_id.required' => '项目ID不能为空', 41 'project_id.required' => '项目ID不能为空',
36 ]); 42 ]);
37 - $projectModel = new Project();  
38 - $project_geo_conf = $projectModel->read(['id' => $this->param['project_id']],['title', 'version', 'geo_status', 'geo_qualify_num']);  
39 - $geoConfModel = new GeoConf();  
40 - $geo_conf = $geoConfModel->read(['project_id' => $this->param['project_id']]);  
41 - if($geo_conf === false){//数据未初始化  
42 - $geo_conf = [  
43 - 'project_id' => $this->param['project_id'],  
44 - 'manager_id'=>0,  
45 - 'company'=>$project_geo_conf['title'],  
46 - 'brand'=>'',  
47 - 'description'=>''  
48 - ];  
49 - }  
50 - //负责人集合  
51 - $geo_manage_list = $geoConfModel->geoManage();  
52 - // geo配置管理员,已经移除管理员列表,补充管理员信息  
53 - if ($geo_conf && $geo_conf['manager_id'] && empty($geo_manage_list[$geo_conf['manager_id']])) {  
54 - $manage = ManageHr::where(['id' => $geo_conf['manager_id']])->pluck('name', 'id')->toArray();  
55 - $geo_manage_list = array_merge($geo_manage_list, $manage);  
56 - }  
57 - $result = [  
58 - 'project_geo_conf' => $project_geo_conf,  
59 - 'geo_conf' => $geo_conf,  
60 - 'geo_manage_list' => $geo_manage_list,  
61 - 'geo_keyword' => [  
62 - 'prefix' => KeywordPrefix::getKeyword($this->param['project_id'], KeywordPrefix::TYPE_GEO_PREFIX),  
63 - 'suffix' => KeywordPrefix::getKeyword($this->param['project_id'], KeywordPrefix::TYPE_GEO_SUFFIX),  
64 - ],  
65 - ];  
66 - $this->response('success', Code::SUCCESS, $result); 43 + $data = $this->logic->getCongInfo($this->param['project_id']);
  44 + $this->response('success', Code::SUCCESS, $data);
67 } 45 }
68 46
69 /** 47 /**
@@ -87,47 +65,11 @@ class GeoController extends BaseController @@ -87,47 +65,11 @@ class GeoController extends BaseController
87 'brand.max' => '品牌名不能超过200个字符', 65 'brand.max' => '品牌名不能超过200个字符',
88 'description.max' => '描述不能超过500个字符', 66 'description.max' => '描述不能超过500个字符',
89 ]); 67 ]);
90 - try {  
91 - $data = GeoConf::saveConf($this->param['project_id'], $this->param['manager_id'], $this->param['company'], $this->param['brand'], $this->param['description'], $this->param['prefix'], $this->param['suffix']);  
92 - # FIXME 保存GEO状态 达标数量 68 + $data = $this->logic->saveConfig($this->param);
93 $this->response('success', Code::SUCCESS, $data); 69 $this->response('success', Code::SUCCESS, $data);
94 - } catch (\Exception $e) {  
95 - $this->fail('配置保存失败, error:' . $e->getMessage());  
96 - }  
97 } 70 }
98 71
99 72
100 - /**  
101 - * 保存确认数据, 并推送微信群  
102 - * @param Request $request  
103 - * @throws \App\Exceptions\AsideGlobalException  
104 - */  
105 - public function saveConfirmContent()  
106 - {  
107 - $this->request->validate([  
108 - 'project_id' => 'required',  
109 - 'type' => 'required|integer',  
110 - 'content' => 'required',  
111 - 'max_num' => 'required',  
112 - ], [  
113 - 'project_id.required' => '项目ID不能为空',  
114 - 'type.required' => '确定数据类型不能为空',  
115 - 'type.integer' => '确定数据类型不正确',  
116 - 'content.required' => '确定数据不能为空',  
117 - 'max_num.required' => '最大确认数量不能为空',  
118 - ]);  
119 - try {  
120 - $data = GeoConfirm::saveContent($this->param['project_id'], $this->param['type'], $this->param['content'], $this->param['max_num']);  
121 - $friend = ProjectAssociation::where(['project_id' => $this->param['project_id']])->first();  
122 - if (empty($friend)){  
123 - $this->fail('项目未绑定微信群, 推送消息失败!');  
124 - }  
125 - $data = GeoConfirm::sendConfirmMessage($data->id, $friend->friend_id);  
126 - $this->response('success', Code::SUCCESS, $data);  
127 - } catch (\Exception $e) {  
128 - $this->fail('操作失败, error:' . $e->getMessage());  
129 - }  
130 - }  
131 73
132 /** 74 /**
133 * OA后台管理员,保存确认数据 75 * OA后台管理员,保存确认数据
@@ -11,7 +11,7 @@ namespace App\Http\Controllers\Aside\Geo; @@ -11,7 +11,7 @@ namespace App\Http\Controllers\Aside\Geo;
11 11
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Http\Controllers\Aside\BaseController; 13 use App\Http\Controllers\Aside\BaseController;
14 -use App\Http\Logic\Aside\Geo\GeoLogic; 14 +use App\Http\Logic\Aside\Geo\GeoQuestionLogic;
15 use Illuminate\Http\Request; 15 use Illuminate\Http\Request;
16 16
17 /** 17 /**
@@ -26,7 +26,7 @@ class GeoQuestionController extends BaseController @@ -26,7 +26,7 @@ class GeoQuestionController extends BaseController
26 public function __construct(Request $request) 26 public function __construct(Request $request)
27 { 27 {
28 parent::__construct($request); 28 parent::__construct($request);
29 - $this->logic = new GeoLogic(); 29 + $this->logic = new GeoQuestionLogic();
30 } 30 }
31 31
32 /** 32 /**
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :GeoConfirmLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/10/25 11:36
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Geo;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Logic\Aside\BaseLogic;
  14 +use App\Models\Geo\GeoConfirm;
  15 +use App\Models\ProjectAssociation\ProjectAssociation;
  16 +
  17 +/**
  18 + * @remark :用户确认信息
  19 + * @name :GeoConfirmLogic
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/10/25 11:37
  23 + */
  24 +class GeoConfirmLogic extends BaseLogic
  25 +{
  26 + public function __construct()
  27 + {
  28 + parent::__construct();
  29 + $this->param = $this->requestAll;
  30 + $this->model = new GeoConfirm();
  31 + }
  32 +
  33 + /**
  34 + * @remark :保存数据->并推送微信群客户确认
  35 + * @name :saveConfirmContent
  36 + * @author :lyh
  37 + * @method :post
  38 + * @time :2025/10/25 11:41
  39 + */
  40 + public function saveConfirmContent($param)
  41 + {
  42 + try {
  43 + $info = $this->model->read(['project_id' => $param['project_id']]);
  44 + if($info === false){
  45 + $id = $this->model->addReturnId($param);
  46 + }else{
  47 + $id = $param['id'];
  48 + $this->model->edit($param,['id'=>$info['id']]);
  49 + }
  50 + $friend = ProjectAssociation::where(['project_id' => $param['project_id']])->first();
  51 + if (empty($friend)){
  52 + $this->fail('项目未绑定微信群, 推送消息失败!');
  53 + }
  54 + GeoConfirm::sendConfirmMessage($id, $friend->friend_id);
  55 + } catch (\Exception $e) {
  56 + $this->fail('操作失败, error:' . $e->getMessage());
  57 + }
  58 + return $this->success(['id'=>$id]);
  59 + }
  60 +}
@@ -4,109 +4,99 @@ @@ -4,109 +4,99 @@
4 * @name :GeoLogic.php 4 * @name :GeoLogic.php
5 * @author :lyh 5 * @author :lyh
6 * @method :post 6 * @method :post
7 - * @time :2025/7/2 17:51 7 + * @time :2025/10/25 11:08
8 */ 8 */
9 9
10 namespace App\Http\Logic\Aside\Geo; 10 namespace App\Http\Logic\Aside\Geo;
11 11
  12 +use App\Enums\Common\Code;
12 use App\Http\Logic\Aside\BaseLogic; 13 use App\Http\Logic\Aside\BaseLogic;
13 -use App\Models\Geo\GeoPlatform; 14 +use App\Models\Geo\GeoConf;
14 use App\Models\Geo\GeoQuestion; 15 use App\Models\Geo\GeoQuestion;
  16 +use App\Models\Manage\ManageHr;
  17 +use App\Models\Project\KeywordPrefix;
15 use App\Models\Project\Project; 18 use App\Models\Project\Project;
16 19
  20 +/**
  21 + * @remark :geo设置
  22 + * @name :GeoLogic
  23 + * @author :lyh
  24 + * @method :post
  25 + * @time :2025/10/25 11:08
  26 + */
17 class GeoLogic extends BaseLogic 27 class GeoLogic extends BaseLogic
18 { 28 {
19 public function __construct() 29 public function __construct()
20 { 30 {
21 parent::__construct(); 31 parent::__construct();
22 $this->param = $this->requestAll; 32 $this->param = $this->requestAll;
23 - $this->model = new GeoQuestion(); 33 + $this->model = new GeoConf();
24 } 34 }
25 35
26 /** 36 /**
27 - * @remark :设置geo状态  
28 - * @name :setGeoStatus 37 + * @remark :获取geo设置数据详情
  38 + * @name :getCongInfo
29 * @author :lyh 39 * @author :lyh
30 * @method :post 40 * @method :post
31 - * @time :2025/7/2 17:51 41 + * @time :2025/10/25 11:10
32 */ 42 */
33 - public function setGeoStatus(){ 43 + public function getCongInfo($project_id)
  44 + {
34 $projectModel = new Project(); 45 $projectModel = new Project();
35 - $data = $projectModel->edit(['geo_status'=>$this->param['geo_status'],'geo_frequency'=>$this->param['geo_frequency']],['id'=>$this->param['project_id']]);  
36 - $questionModel = new GeoQuestion();  
37 - $questionModel->edit(['status'=>$this->param['geo_status']],['project_id'=>$this->param['project_id']]);  
38 - return $this->success($data); 46 + $project_geo_conf = $projectModel->read(['id' => $project_id],['title', 'version', 'geo_status', 'geo_qualify_num']);
  47 + $geoConfModel = new GeoConf();
  48 + $geo_conf = $geoConfModel->read(['project_id' => $project_id]);
  49 + if($geo_conf === false){//数据未初始化
  50 + $geo_conf = [
  51 + 'project_id' => $project_id, 'manager_id'=>0, 'company'=>$project_geo_conf['title'], 'brand'=>'', 'description'=>''
  52 + ];
39 } 53 }
40 -  
41 - /**  
42 - * @remark :获取类型  
43 - * @name :getType  
44 - * @author :lyh  
45 - * @method :post  
46 - * @time :2025/7/3 10:47  
47 - */  
48 - public function getType(){  
49 - $data['type'] = $this->model->brandType();  
50 - $data['frequency'] = $this->model->frequency;  
51 - $geoPlatformModel = new GeoPlatform();  
52 - $data['platform'] = $geoPlatformModel->getList();  
53 - return $this->success($data);  
54 - }  
55 -  
56 - /**  
57 - * @remark :获取问题列表  
58 - * @name :getGeoQuestionList  
59 - * @author :lyh  
60 - * @method :post  
61 - * @time :2025/7/3 9:12  
62 - */  
63 - public function getGeoQuestionList($map,$page,$row,$order,$field = ['*']){  
64 - $data = $this->model->lists($map,$page,$row,$order,$field);  
65 - if(!empty($data) && !empty($data['list'])){  
66 - foreach ($data['list'] as $key => $item){  
67 - $item['type_name'] = $this->model->brandType()[$item['type']];  
68 - $data['list'][$key] = $item; 54 + //负责人集合
  55 + $geo_manage_list = $geoConfModel->geoManage();
  56 + // geo配置管理员,已经移除管理员列表,补充管理员信息
  57 + if ($geo_conf && $geo_conf['manager_id'] && empty($geo_manage_list[$geo_conf['manager_id']])) {
  58 + $manage = ManageHr::where(['id' => $geo_conf['manager_id']])->pluck('name', 'id')->toArray();
  59 + $geo_manage_list = array_merge($geo_manage_list, $manage);
69 } 60 }
70 - }  
71 - return $this->success($data); 61 + $result = [
  62 + 'project_geo_conf' => $project_geo_conf,
  63 + 'geo_conf' => $geo_conf,
  64 + 'geo_manage_list' => $geo_manage_list,
  65 + 'geo_keyword' => [
  66 + 'prefix' => KeywordPrefix::getKeyword($project_id, KeywordPrefix::TYPE_GEO_PREFIX),
  67 + 'suffix' => KeywordPrefix::getKeyword($project_id, KeywordPrefix::TYPE_GEO_SUFFIX),
  68 + ],
  69 + ];
  70 + $this->success($result);
72 } 71 }
73 72
74 /** 73 /**
75 - * @remark :保存数据  
76 - * @name :saveGeoQuestion 74 + * @remark :保存数据详情
  75 + * @name :saveCongInfo
77 * @author :lyh 76 * @author :lyh
78 * @method :post 77 * @method :post
79 - * @time :2025/7/3 9:47  
80 - * @param : question->提交的问题  
81 - * @param : url->提交的网址  
82 - * @param : keywords->提交的关键字  
83 - * @param : project_id->项目id 78 + * @time :2025/10/25 11:14
  79 + * @param->gl_geo_conf : project_id->项目id;manager_id->管理员id;company->公司名称;brand->品牌名;description->描述(必传)
  80 + * @param :prefix->前缀;suffix->后缀(非必传)
  81 + * @param->gl_project : geo_status->开启/关闭状态 geo_qualify_num->达标数量
84 */ 82 */
85 - public function saveGeoQuestion(){  
86 - //处理数据  
87 - $this->param['question'] = json_encode($this->param['question'] ?? [],true);  
88 - $this->param['url'] = json_encode($this->param['url'] ?? [],true);  
89 - $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);  
90 - //执行时间设置为今天  
91 - if(isset($this->param['id']) && !empty($this->param['id'])){  
92 - $id = $this->param['id'];  
93 - $this->model->edit($this->param,['id'=>$id]); 83 + public function saveConfig($param)
  84 + {
  85 + $projectModel = new Project();
  86 + $projectModel->edit(['geo_status'=>$param['geo_status'],'geo_qualify_num'=>$param['geo_qualify_num']],['id'=>$param['project_id']]);
  87 + try {
  88 + unset($param['geo_status'],$param['geo_qualify_num']);//无需保存
  89 + $info = $this->model->read(['project_id' => $param['project_id']]);
  90 + if($info === false){
  91 + $id = $this->model->addReturnId($param);
94 }else{ 92 }else{
95 - $this->param['next_time'] = date('Y-m-d');  
96 - $id = $this->model->addReturnId($this->param); 93 + $id = $param['id'];
  94 + $this->model->edit($param,['id'=>$info['id']]);
  95 + }
  96 + } catch (\Exception $e) {
  97 + $this->fail('配置保存失败, error:' . $e->getMessage());
97 } 98 }
98 return $this->success(['id'=>$id]); 99 return $this->success(['id'=>$id]);
99 } 100 }
100 101
101 - /**  
102 - * @remark :删除数据  
103 - * @name :delGeoQuestion  
104 - * @author :lyh  
105 - * @method :post  
106 - * @time :2025/7/3 10:13  
107 - */  
108 - public function delGeoQuestion(){  
109 - $data = $this->model->del(['id'=>['in',$this->param['ids']]]);  
110 - return $this->success($data);  
111 - }  
112 } 102 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :GeoQuestionLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/7/2 17:51
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Geo;
  11 +
  12 +use App\Http\Logic\Aside\BaseLogic;
  13 +use App\Models\Geo\GeoPlatform;
  14 +use App\Models\Geo\GeoQuestion;
  15 +use App\Models\Project\Project;
  16 +
  17 +class GeoQuestionLogic extends BaseLogic
  18 +{
  19 + public function __construct()
  20 + {
  21 + parent::__construct();
  22 + $this->param = $this->requestAll;
  23 + $this->model = new GeoQuestion();
  24 + }
  25 +
  26 + /**
  27 + * @remark :设置geo状态
  28 + * @name :setGeoStatus
  29 + * @author :lyh
  30 + * @method :post
  31 + * @time :2025/7/2 17:51
  32 + */
  33 + public function setGeoStatus(){
  34 + $projectModel = new Project();
  35 + $data = $projectModel->edit(['geo_status'=>$this->param['geo_status'],'geo_frequency'=>$this->param['geo_frequency']],['id'=>$this->param['project_id']]);
  36 + $questionModel = new GeoQuestion();
  37 + $questionModel->edit(['status'=>$this->param['geo_status']],['project_id'=>$this->param['project_id']]);
  38 + return $this->success($data);
  39 + }
  40 +
  41 + /**
  42 + * @remark :获取类型
  43 + * @name :getType
  44 + * @author :lyh
  45 + * @method :post
  46 + * @time :2025/7/3 10:47
  47 + */
  48 + public function getType(){
  49 + $data['type'] = $this->model->brandType();
  50 + $data['frequency'] = $this->model->frequency;
  51 + $geoPlatformModel = new GeoPlatform();
  52 + $data['platform'] = $geoPlatformModel->getList();
  53 + return $this->success($data);
  54 + }
  55 +
  56 + /**
  57 + * @remark :获取问题列表
  58 + * @name :getGeoQuestionList
  59 + * @author :lyh
  60 + * @method :post
  61 + * @time :2025/7/3 9:12
  62 + */
  63 + public function getGeoQuestionList($map,$page,$row,$order,$field = ['*']){
  64 + $data = $this->model->lists($map,$page,$row,$order,$field);
  65 + if(!empty($data) && !empty($data['list'])){
  66 + foreach ($data['list'] as $key => $item){
  67 + $item['type_name'] = $this->model->brandType()[$item['type']];
  68 + $data['list'][$key] = $item;
  69 + }
  70 + }
  71 + return $this->success($data);
  72 + }
  73 +
  74 + /**
  75 + * @remark :保存数据
  76 + * @name :saveGeoQuestion
  77 + * @author :lyh
  78 + * @method :post
  79 + * @time :2025/7/3 9:47
  80 + * @param : question->提交的问题
  81 + * @param : url->提交的网址
  82 + * @param : keywords->提交的关键字
  83 + * @param : project_id->项目id
  84 + */
  85 + public function saveGeoQuestion(){
  86 + //处理数据
  87 + $this->param['question'] = json_encode($this->param['question'] ?? [],true);
  88 + $this->param['url'] = json_encode($this->param['url'] ?? [],true);
  89 + $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
  90 + //执行时间设置为今天
  91 + if(isset($this->param['id']) && !empty($this->param['id'])){
  92 + $id = $this->param['id'];
  93 + $this->model->edit($this->param,['id'=>$id]);
  94 + }else{
  95 + $this->param['next_time'] = date('Y-m-d');
  96 + $id = $this->model->addReturnId($this->param);
  97 + }
  98 + return $this->success(['id'=>$id]);
  99 + }
  100 +
  101 + /**
  102 + * @remark :删除数据
  103 + * @name :delGeoQuestion
  104 + * @author :lyh
  105 + * @method :post
  106 + * @time :2025/7/3 10:13
  107 + */
  108 + public function delGeoQuestion(){
  109 + $data = $this->model->del(['id'=>['in',$this->param['ids']]]);
  110 + return $this->success($data);
  111 + }
  112 +}
@@ -23,33 +23,6 @@ class GeoConf extends Base @@ -23,33 +23,6 @@ class GeoConf extends Base
23 */ 23 */
24 protected $table = 'gl_project_geo_conf'; 24 protected $table = 'gl_project_geo_conf';
25 25
26 - /**  
27 - * 保存GEO相关配置  
28 - * @param $project_id  
29 - * @param $manager_id  
30 - * @param $company  
31 - * @param $brand  
32 - * @param $description  
33 - * @param $prefix  
34 - * @param $suffix  
35 - * @return GeoConf  
36 - */  
37 - public static function saveConf($project_id, $manager_id, $company, $brand, $description, $prefix, $suffix)  
38 - {  
39 - $data = self::where(compact('project_id'))->first();  
40 - if (empty($data)) {  
41 - $data = new self();  
42 - $data->project_id = $project_id;  
43 - }  
44 - $data->manager_id = $manager_id;  
45 - $data->company = $company;  
46 - $data->brand = $brand;  
47 - $data->description = $description;  
48 - $data->prefix = $prefix;  
49 - $data->suffix = $suffix;  
50 - $data->save();  
51 - return $data;  
52 - }  
53 26
54 /** 27 /**
55 * GEO 负责人集合 28 * GEO 负责人集合
@@ -60,26 +60,6 @@ class GeoConfirm extends Base @@ -60,26 +60,6 @@ class GeoConfirm extends Base
60 ]; 60 ];
61 } 61 }
62 62
63 - /**  
64 - * @param $project_id  
65 - * @param $type  
66 - * @param $content  
67 - * @param $max_num  
68 - * @return GeoConfirm  
69 - */  
70 - public static function saveContent($project_id, $type, $content, $max_num)  
71 - {  
72 - $data = self::where(compact('project_id', 'type'))->first();  
73 - if (empty($data)) {  
74 - $data = new self();  
75 - $data->project_id = $project_id;  
76 - $data->type = $type;  
77 - }  
78 - $data->content = $content;  
79 - $data->max_num = $max_num;  
80 - $data->save();  
81 - return $data;  
82 - }  
83 63
84 /** 64 /**
85 * 保存确认数据 65 * 保存确认数据
@@ -8,6 +8,7 @@ use App\Models\Base; @@ -8,6 +8,7 @@ use App\Models\Base;
8 use Illuminate\Database\Eloquent\SoftDeletes; 8 use Illuminate\Database\Eloquent\SoftDeletes;
9 use Illuminate\Support\Facades\DB; 9 use Illuminate\Support\Facades\DB;
10 use Illuminate\Support\Facades\Log; 10 use Illuminate\Support\Facades\Log;
  11 +use Illuminate\Support\Str;
11 12
12 /** 13 /**
13 * Class InquiryFormData 14 * Class InquiryFormData
@@ -141,99 +142,103 @@ class InquiryFormData extends Base @@ -141,99 +142,103 @@ class InquiryFormData extends Base
141 ]; 142 ];
142 $url_map = [ 143 $url_map = [
143 'luchfitness' => [ 144 'luchfitness' => [
144 - 'https://www.ntsportgoods.com/supplier/nantong-luch-fitness-co-ltd',  
145 - 'https://www.ntsportgoods.com/benches-machines-luch-fitness/',  
146 - 'https://www.ntsportgoods.com/free-weight-luch-fitness/',  
147 - 'https://www.ntsportgoods.com/functional-training-luch-fitness/s/',  
148 - 'https://www.ntsportgoods.com/studio-exercise-luch-fitness/',  
149 - 'https://www.ntsportgoods.com/commercial-gym-half-power-rack-for-strength-training-product',  
150 - 'https://www.ntsportgoods.com/heavy-duty-fitness-flat-bench-for-home-commercial-gym-product',  
151 - 'https://www.ntsportgoods.com/durable-gym-dumbbell-flat-bench-for-weight-training-product',  
152 - 'https://www.ntsportgoods.com/rubber-colored-bumper-plate-for-olympic-weightlifting-product',  
153 - 'https://www.ntsportgoods.com/urethane-competition-bumper-plate-for-strength-training-product',  
154 - 'https://www.ntsportgoods.com/10-pair-dumbbell-storage-rack-for-commercial-gyms-product',  
155 - 'https://www.ntsportgoods.com/tpu-coated-dumbbells-for-home-and-commercial-fitness-product',  
156 - 'https://www.ntsportgoods.com/urethane-weight-plate-for-powerlifting-strength-gym-product',  
157 - 'https://www.ntsportgoods.com/iphifun-cpu-weight-plate-for-professional-training-product',  
158 - 'https://www.ntsportgoods.com/men-s-weightlifting-barbell-bar-for-strength-training-product',  
159 - 'https://www.ntsportgoods.com/women-s-weightlifting-barbell-bar-for-olympic-lifts-product',  
160 - 'https://www.ntsportgoods.com/steel-competition-kettlebell-for-functional-training-product',  
161 - 'https://www.ntsportgoods.com/adjustable-strength-jump-plyo-boxes-for-gym-training-product',  
162 - 'https://www.ntsportgoods.com/commercial-soft-plyo-box-for-functional-gym-training-product',  
163 - 'https://www.ntsportgoods.com/power-training-weight-bull-bag-for-strength-workout-product',  
164 - 'https://www.ntsportgoods.com/pu-leather-power-bag-for-functional-strength-training-product',  
165 - 'https://www.ntsportgoods.com/abdominal-muscle-mat-for-core-and-sit-up-training-product',  
166 - 'https://www.ntsportgoods.com/gymnastics-training-mat-for-fitness-and-yoga-workout-product',  
167 - 'https://www.ntsportgoods.com/adjustable-bench-stepper-for-aerobic-and-strength-gym-product',  
168 - 'https://www.ntsportgoods.com/rubber-body-pump-set-for-cardio-and-strength-training-product',  
169 - 'https://www.ntsportgoods.com/balance-training-yoga-ball-for-core-stability-workout-product',  
170 - 'https://www.ntsportgoods.com/pull-up-resistance-band-for-strength-and-stretching-product', 145 + '/supplier/nantong-luch-fitness-co-ltd',
  146 + '/benches-machines-luch-fitness',
  147 + '/free-weight-luch-fitness',
  148 + '/functional-training-luch-fitness/s',
  149 + '/studio-exercise-luch-fitness',
  150 + '/commercial-gym-half-power-rack-for-strength-training-product',
  151 + '/heavy-duty-fitness-flat-bench-for-home-commercial-gym-product',
  152 + '/durable-gym-dumbbell-flat-bench-for-weight-training-product',
  153 + '/rubber-colored-bumper-plate-for-olympic-weightlifting-product',
  154 + '/urethane-competition-bumper-plate-for-strength-training-product',
  155 + '/10-pair-dumbbell-storage-rack-for-commercial-gyms-product',
  156 + '/tpu-coated-dumbbells-for-home-and-commercial-fitness-product',
  157 + '/urethane-weight-plate-for-powerlifting-strength-gym-product',
  158 + '/iphifun-cpu-weight-plate-for-professional-training-product',
  159 + '/men-s-weightlifting-barbell-bar-for-strength-training-product',
  160 + '/women-s-weightlifting-barbell-bar-for-olympic-lifts-product',
  161 + '/steel-competition-kettlebell-for-functional-training-product',
  162 + '/adjustable-strength-jump-plyo-boxes-for-gym-training-product',
  163 + '/commercial-soft-plyo-box-for-functional-gym-training-product',
  164 + '/power-training-weight-bull-bag-for-strength-workout-product',
  165 + '/pu-leather-power-bag-for-functional-strength-training-product',
  166 + '/abdominal-muscle-mat-for-core-and-sit-up-training-product',
  167 + '/gymnastics-training-mat-for-fitness-and-yoga-workout-product',
  168 + '/adjustable-bench-stepper-for-aerobic-and-strength-gym-product',
  169 + '/rubber-body-pump-set-for-cardio-and-strength-training-product',
  170 + '/balance-training-yoga-ball-for-core-stability-workout-product',
  171 + '/pull-up-resistance-band-for-strength-and-stretching-product',
171 ], 172 ],
172 'modernsporting' => [ 173 'modernsporting' => [
173 - 'https://www.ntsportgoods.com/supplier/nantong-modern-sporting-industrial-co-ltdhttps://www.ntsportgoods.com/barbell-bars-modern-sporting/',  
174 - 'https://www.ntsportgoods.com/storage-racks-modern-sporting/',  
175 - 'https://www.ntsportgoods.com/dumbbells-modern-sporting/',  
176 - 'https://www.ntsportgoods.com/rubber-plates-modern-sporting/',  
177 - 'https://www.ntsportgoods.com/training-handles-modern-sporting/https://www.ntsportgoods.com/md4137-201cm-weightlifting-beginner-bar-product',  
178 - 'https://www.ntsportgoods.com/md4143-220cm-hybrid-training-bar-product',  
179 - 'https://www.ntsportgoods.com/md4149-powder-coated-pentagon-bar-product',  
180 - 'https://www.ntsportgoods.com/gym-home-10-pairs-dumbbell-rack-stand-md6242-product',  
181 - 'https://www.ntsportgoods.com/10-pairs-dumbbell-rack-for-home-gym-workouts-md6247-product',  
182 - 'https://www.ntsportgoods.com/10-pairs-dumbbell-storage-rack-for-gym-home-md6250-product',  
183 - 'https://www.ntsportgoods.com/urethane-dumbbells-set-for-strength-training-md2117-product',  
184 - 'https://www.ntsportgoods.com/md2123-rubber-coated-studio-dumbbells-product',  
185 - 'https://www.ntsportgoods.com/md2135-12-side-tpu-coated-dumbbells-product',  
186 - 'https://www.ntsportgoods.com/rubber-bumper-plates-for-weightlifting-gym-use-md1056-product',  
187 - 'https://www.ntsportgoods.com/high-quality-rubber-bumper-plates-for-gym-lifting-md1057-product',  
188 - 'https://www.ntsportgoods.com/md1058-competition-weight-plates-product',  
189 - 'https://www.ntsportgoods.com/tricep-press-down-bar-for-cable-machines-strength-md5128-product',  
190 - 'https://www.ntsportgoods.com/md5132-tricep-press-down-bar-product',  
191 - 'https://www.ntsportgoods.com/md5132-tricep-press-down-bar-product', 174 + '/supplier/nantong-modern-sporting-industrial-co-ltd',
  175 + '/barbell-bars-modern-sporting',
  176 + '/storage-racks-modern-sporting',
  177 + '/dumbbells-modern-sporting',
  178 + '/rubber-plates-modern-sporting',
  179 + '/training-handles-modern-sporting',
  180 + '/md4137-201cm-weightlifting-beginner-bar-product',
  181 + '/md4143-220cm-hybrid-training-bar-product',
  182 + '/md4149-powder-coated-pentagon-bar-product',
  183 + '/gym-home-10-pairs-dumbbell-rack-stand-md6242-product',
  184 + '/10-pairs-dumbbell-rack-for-home-gym-workouts-md6247-product',
  185 + '/10-pairs-dumbbell-storage-rack-for-gym-home-md6250-product',
  186 + '/urethane-dumbbells-set-for-strength-training-md2117-product',
  187 + '/md2123-rubber-coated-studio-dumbbells-product',
  188 + '/md2135-12-side-tpu-coated-dumbbells-product',
  189 + '/rubber-bumper-plates-for-weightlifting-gym-use-md1056-product',
  190 + '/high-quality-rubber-bumper-plates-for-gym-lifting-md1057-product',
  191 + '/md1058-competition-weight-plates-product',
  192 + '/tricep-press-down-bar-for-cable-machines-strength-md5128-product',
  193 + '/md5132-tricep-press-down-bar-product',
  194 + '/md5132-tricep-press-down-bar-product',
192 ], 195 ],
193 'liveupsports' => [ 196 'liveupsports' => [
194 - 'https://www.ntsportgoods.com/supplier/nantong-liveup-sports-co-ltd/',  
195 - 'https://www.ntsportgoods.com/yoga-pilates-liveup-sports/',  
196 - 'https://www.ntsportgoods.com/training-equipment-liveup-sports/',  
197 - 'https://www.ntsportgoods.com/gym-racks-and-equipment-liveup-sports/',  
198 - 'https://www.ntsportgoods.com/20-25-30cm-pvc-customised-pilates-stability-exercise-ball-inflatable-soft-mini-pilates-small-yoga-bal-product/',  
199 - 'https://www.ntsportgoods.com/55-65-75cm-bloom-workout-fitness-exercise-balance-gym-abs-anti-burst-yoga-ball-anti-slip-swiss-pilates-ball-product/',  
200 - 'https://www.ntsportgoods.com/bodybuilding-fitness-exercise-custom-logo-gym-yoga-latex-hip-resistance-bands-loop-bands-set-product/',  
201 - 'https://www.ntsportgoods.com/bloom-2080x4-5cm-natural-latex-loop-yoga-elastic-stretch-long-resistance-bands-exercise-band-product/',  
202 - 'https://www.ntsportgoods.com/custom-logo-manufacturer-high-quality-eco-friendly-fitness-pilates-anti-slip-3-10mm-pu-rubber-tpe-cork-nbr-pvc-printed-yoga-mat-product/',  
203 - 'https://www.ntsportgoods.com/custom-professional-manufacture-cheap-solid-cast-iron-dumbbell-weights-rubber-hex-dumbbell-sets-5-100lb-product/',  
204 - 'https://www.ntsportgoods.com/professional-wholesale-custom-logo-free-weight-colored-rubber-bumper-gym-weight-barbell-plates-with-kg-mark-product/',  
205 - 'https://www.ntsportgoods.com/gym-equipment-free-weights-fitness-12-sided-weightlifting-exercise-barbell-weight-lifting-polyurethane-fixed-barbell-product/',  
206 - 'https://www.ntsportgoods.com/livepro-high-quality-steel-fitness-equipment-training-competition-gym-power-weightlifting-20kg-barbell-bar-product/',  
207 - 'https://www.ntsportgoods.com/livepro-gym-commercial-equipment-fitness-storage-system-professional-multifunctional-training-frame-gym-storage-rack-product/',  
208 - 'https://www.ntsportgoods.com/livepro-commercial-floor-mount-free-standing-cross-training-gym-rigs-multi-functional-training-rack-fitness-gym-rig-product/',  
209 - 'https://www.ntsportgoods.com/livepro-oem-odm-fitness-equipment-multi-functional-trainer-smith-machine-station-home-using-gym-full-frame-cage-squat-power-rack-product/', 197 + '/supplier/nantong-liveup-sports-co-ltd',
  198 + '/yoga-pilates-liveup-sports',
  199 + '/training-equipment-liveup-sports',
  200 + '/gym-racks-and-equipment-liveup-sports',
  201 + '/20-25-30cm-pvc-customised-pilates-stability-exercise-ball-inflatable-soft-mini-pilates-small-yoga-bal-product',
  202 + '/55-65-75cm-bloom-workout-fitness-exercise-balance-gym-abs-anti-burst-yoga-ball-anti-slip-swiss-pilates-ball-product',
  203 + '/bodybuilding-fitness-exercise-custom-logo-gym-yoga-latex-hip-resistance-bands-loop-bands-set-product',
  204 + '/bloom-2080x4-5cm-natural-latex-loop-yoga-elastic-stretch-long-resistance-bands-exercise-band-product',
  205 + '/custom-logo-manufacturer-high-quality-eco-friendly-fitness-pilates-anti-slip-3-10mm-pu-rubber-tpe-cork-nbr-pvc-printed-yoga-mat-product',
  206 + '/custom-professional-manufacture-cheap-solid-cast-iron-dumbbell-weights-rubber-hex-dumbbell-sets-5-100lb-product',
  207 + '/professional-wholesale-custom-logo-free-weight-colored-rubber-bumper-gym-weight-barbell-plates-with-kg-mark-product',
  208 + '/gym-equipment-free-weights-fitness-12-sided-weightlifting-exercise-barbell-weight-lifting-polyurethane-fixed-barbell-product',
  209 + '/livepro-high-quality-steel-fitness-equipment-training-competition-gym-power-weightlifting-20kg-barbell-bar-product',
  210 + '/livepro-gym-commercial-equipment-fitness-storage-system-professional-multifunctional-training-frame-gym-storage-rack-product',
  211 + '/livepro-commercial-floor-mount-free-standing-cross-training-gym-rigs-multi-functional-training-rack-fitness-gym-rig-product',
  212 + '/livepro-oem-odm-fitness-equipment-multi-functional-trainer-smith-machine-station-home-using-gym-full-frame-cage-squat-power-rack-product',
210 ], 213 ],
211 'topflor' => [ 214 'topflor' => [
212 - 'https://www.ntsportgoods.com/supplier/nantong-topflor-co-ltd/',  
213 - 'https://www.ntsportgoods.com/sports-flooring-topflor/',  
214 - 'https://www.ntsportgoods.com/healthcare-flooring-topflor/',  
215 - 'https://www.ntsportgoods.com/gym-flooring-topflor/',  
216 - 'https://www.ntsportgoods.com/sprint-track-turf-for-high-performance-indoor-and-outdoor-training-product/',  
217 - 'https://www.ntsportgoods.com/durable-gym-rubber-flooring-with-shock-absorption-and-slip-resistance-product/',  
218 - 'https://www.ntsportgoods.com/interlocking-gym-flooring-tilesinterlocking-gym-flooring-tiles-product/',  
219 - 'https://www.ntsportgoods.com/premium-hospital-vinyl-flooring-with-anti-bacterial-and-easy-clean-surface-product/',  
220 - 'https://www.ntsportgoods.com/high-performance-healthcare-flooring-for-safe-and-hygienic-environments-product/',  
221 - 'https://www.ntsportgoods.com/homogeneous-vinyl-flooring-with-high-durability-and-low-maintenance-product/',  
222 - 'https://www.ntsportgoods.com/clinic-vinyl-flooring-with-anti-bacterial-and-wear-resistant-properties-product/',  
223 - 'https://www.ntsportgoods.com/medical-pvc-flooring-with-anti-slip-hygienic-and-durable-features-product/',  
224 - 'https://www.ntsportgoods.com/professional-badminton-court-pvc-sports-flooring-with-high-grip-and-shock-absorption-product/',  
225 - 'https://www.ntsportgoods.com/indoor-basketball-sports-flooring-with-superior-ball-bounce-and-player-comfort-product/',  
226 - 'https://www.ntsportgoods.com/multi-sport-indoor-pvc-flooring-for-volleyball-handball-badminton-and-fitness-product/',  
227 - 'https://www.ntsportgoods.com/durable-multi-purpose-sports-flooring-for-schools-gyms-and-community-centers-product/',  
228 - 'https://www.ntsportgoods.com/high-performance-multi-use-indoor-sports-flooring-with-easy-maintenance-product/', 215 + '/supplier/nantong-topflor-co-ltd',
  216 + '/sports-flooring-topflor',
  217 + '/healthcare-flooring-topflor',
  218 + '/gym-flooring-topflor',
  219 + '/sprint-track-turf-for-high-performance-indoor-and-outdoor-training-product',
  220 + '/durable-gym-rubber-flooring-with-shock-absorption-and-slip-resistance-product',
  221 + '/interlocking-gym-flooring-tilesinterlocking-gym-flooring-tiles-product',
  222 + '/premium-hospital-vinyl-flooring-with-anti-bacterial-and-easy-clean-surface-product',
  223 + '/high-performance-healthcare-flooring-for-safe-and-hygienic-environments-product',
  224 + '/homogeneous-vinyl-flooring-with-high-durability-and-low-maintenance-product',
  225 + '/clinic-vinyl-flooring-with-anti-bacterial-and-wear-resistant-properties-product',
  226 + '/medical-pvc-flooring-with-anti-slip-hygienic-and-durable-features-product',
  227 + '/professional-badminton-court-pvc-sports-flooring-with-high-grip-and-shock-absorption-product',
  228 + '/indoor-basketball-sports-flooring-with-superior-ball-bounce-and-player-comfort-product',
  229 + '/multi-sport-indoor-pvc-flooring-for-volleyball-handball-badminton-and-fitness-product',
  230 + '/durable-multi-purpose-sports-flooring-for-schools-gyms-and-community-centers-product',
  231 + '/high-performance-multi-use-indoor-sports-flooring-with-easy-maintenance-product',
229 ], 232 ],
230 233
231 ]; 234 ];
232 foreach ($url_map as $k=>$urls) { 235 foreach ($url_map as $k=>$urls) {
233 - if(in_array($referer, $urls)) { 236 + foreach ($urls as $url) {
  237 + if(Str::contains($referer, $url)){
234 return $mail_mobile_map[$k]; 238 return $mail_mobile_map[$k];
235 } 239 }
236 } 240 }
  241 + }
237 return $mail_mobile_map[array_rand($mail_mobile_map)]; 242 return $mail_mobile_map[array_rand($mail_mobile_map)];
238 } 243 }
239 244
@@ -586,11 +586,14 @@ Route::middleware(['aloginauth'])->group(function () { @@ -586,11 +586,14 @@ Route::middleware(['aloginauth'])->group(function () {
586 Route::any('/downloadGeoLink', [Aside\Geo\GeoLinkController::class, 'downloadGeoLink'])->name('admin.geo_link_downloadGeoLink'); 586 Route::any('/downloadGeoLink', [Aside\Geo\GeoLinkController::class, 'downloadGeoLink'])->name('admin.geo_link_downloadGeoLink');
587 Route::any('/daResultData', [Aside\Geo\GeoLinkController::class, 'daResultData'])->name('admin.geo_link_daResultData'); 587 Route::any('/daResultData', [Aside\Geo\GeoLinkController::class, 'daResultData'])->name('admin.geo_link_daResultData');
588 }); 588 });
589 - //geo设置 589 + //geo信息详情设置
590 Route::prefix('conf')->group(function () { 590 Route::prefix('conf')->group(function () {
591 Route::any('/getConfig', [Aside\Geo\GeoController::class, 'getConfig'])->name('admin.geo_conf_getConfig'); 591 Route::any('/getConfig', [Aside\Geo\GeoController::class, 'getConfig'])->name('admin.geo_conf_getConfig');
592 Route::any('/saveConfig', [Aside\Geo\GeoController::class, 'saveConfig'])->name('admin.geo_conf_saveConfig'); 592 Route::any('/saveConfig', [Aside\Geo\GeoController::class, 'saveConfig'])->name('admin.geo_conf_saveConfig');
593 - Route::any('/saveConfirmContent', [Aside\Geo\GeoController::class, 'saveConfirmContent'])->name('admin.geo_conf_saveConfirmContent'); 593 + });
  594 + //geo客户确认信息
  595 + Route::prefix('confirm')->group(function () {
  596 + Route::any('/saveConfirmContent', [Aside\Geo\GeoConfirmController::class, 'saveConfirmContent'])->name('admin.geo_confirm_saveConfirmContent');
594 }); 597 });
595 }); 598 });
596 // 任务相关 599 // 任务相关