作者 lyh

gx

@@ -182,7 +182,10 @@ class OptimizeController extends BaseController @@ -182,7 +182,10 @@ class OptimizeController extends BaseController
182 }); 182 });
183 } 183 }
184 if(isset($this->map['domain']) && !empty($this->map['domain'])){ 184 if(isset($this->map['domain']) && !empty($this->map['domain'])){
185 - $query = $query->where('gl_project_deploy_optimize.domain','like','%'.$this->map['domain'].'%'); 185 + $parsedUrl = parse_url($this->map['domain']);
  186 + $this->map['domain'] = $parsedUrl['host'] ?? $this->map['domain'];
  187 + $ids = DomainInfo::where('domain', 'like', '%'.$this->map['domain'].'%')->pluck('id')->toArray();
  188 + $query = $query->whereIn('gl_project_deploy_optimize.domain', $ids);
186 } 189 }
187 if(isset($this->map['test_domain']) && !empty($this->map['test_domain'])){ 190 if(isset($this->map['test_domain']) && !empty($this->map['test_domain'])){
188 $query = $query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['test_domain'].'%'); 191 $query = $query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['test_domain'].'%');
@@ -179,6 +179,8 @@ class ProjectController extends BaseController @@ -179,6 +179,8 @@ class ProjectController extends BaseController
179 $query->where(function ($subQuery) { 179 $query->where(function ($subQuery) {
180 // 搜索域名 180 // 搜索域名
181 if ($this->map['search_type'] == 'domain') { 181 if ($this->map['search_type'] == 'domain') {
  182 + $parsedUrl = parse_url($this->map['search']);
  183 + $this->map['search'] = $parsedUrl['host'] ?? $this->map['search'];
182 $ids = DomainInfo::where('domain', 'like', '%'.$this->map['search'].'%')->pluck('id')->toArray(); 184 $ids = DomainInfo::where('domain', 'like', '%'.$this->map['search'].'%')->pluck('id')->toArray();
183 $subQuery->whereIn('gl_project_deploy_optimize.domain', $ids); 185 $subQuery->whereIn('gl_project_deploy_optimize.domain', $ids);
184 } else if($this->map['search_type'] == 'test_domain'){ 186 } else if($this->map['search_type'] == 'test_domain'){
@@ -333,8 +335,8 @@ class ProjectController extends BaseController @@ -333,8 +335,8 @@ class ProjectController extends BaseController
333 * @method :post 335 * @method :post
334 * @time :2023/8/17 16:42 336 * @time :2023/8/17 16:42
335 */ 337 */
336 - public function info(Request $request, ProjectLogic $logic){  
337 - $request->validate([ 338 + public function info(ProjectLogic $logic){
  339 + $this->request->validate([
338 'id'=>'required' 340 'id'=>'required'
339 ],[ 341 ],[
340 'id.required' => 'ID不能为空' 342 'id.required' => 'ID不能为空'
@@ -352,17 +354,17 @@ class ProjectController extends BaseController @@ -352,17 +354,17 @@ class ProjectController extends BaseController
352 */ 354 */
353 public function save(ProjectLogic $logic) 355 public function save(ProjectLogic $logic)
354 { 356 {
  357 + $this->request->validate([
  358 + 'type'=>'required'
  359 + ],[
  360 + 'type.required' => '类型不能为空'
  361 + ]);
355 $logic->projectSave(); 362 $logic->projectSave();
356 $this->response('success'); 363 $this->response('success');
357 } 364 }
358 365
359 /** 366 /**
360 * 询盘通知设置 367 * 询盘通知设置
361 - * @param ProjectRequest $request  
362 - * @param ProjectLogic $logic  
363 - * @return \Illuminate\Http\JsonResponse  
364 - * @throws \Psr\Container\ContainerExceptionInterface  
365 - * @throws \Psr\Container\NotFoundExceptionInterface  
366 * @author zbj 368 * @author zbj
367 * @date 2023/5/17 369 * @date 2023/5/17
368 */ 370 */
@@ -400,10 +402,6 @@ class ProjectController extends BaseController @@ -400,10 +402,6 @@ class ProjectController extends BaseController
400 402
401 /** 403 /**
402 * 省市数据源 404 * 省市数据源
403 - * @param ProjectLogic $logic  
404 - * @return \Illuminate\Http\JsonResponse  
405 - * @throws \Psr\Container\ContainerExceptionInterface  
406 - * @throws \Psr\Container\NotFoundExceptionInterface  
407 * @author zbj 405 * @author zbj
408 * @date 2023/6/27 406 * @date 2023/6/27
409 */ 407 */
@@ -414,10 +412,6 @@ class ProjectController extends BaseController @@ -414,10 +412,6 @@ class ProjectController extends BaseController
414 412
415 /** 413 /**
416 * 渠道数据源 414 * 渠道数据源
417 - * @param ProjectLogic $logic  
418 - * @return \Illuminate\Http\JsonResponse  
419 - * @throws \Psr\Container\ContainerExceptionInterface  
420 - * @throws \Psr\Container\NotFoundExceptionInterface  
421 * @author zbj 415 * @author zbj
422 * @date 2023/6/27 416 * @date 2023/6/27
423 */ 417 */
@@ -750,6 +744,13 @@ class ProjectController extends BaseController @@ -750,6 +744,13 @@ class ProjectController extends BaseController
750 $this->response('success',Code::SUCCESS,$list); 744 $this->response('success',Code::SUCCESS,$list);
751 } 745 }
752 746
  747 + /**
  748 + * @remark :处理tdk
  749 + * @name :handleTdk
  750 + * @author :lyh
  751 + * @method :post
  752 + * @time :2023/12/29 11:16
  753 + */
753 public function handleTdk($item){ 754 public function handleTdk($item){
754 $data = [ 755 $data = [
755 'gl_product'=>'产品', 756 'gl_product'=>'产品',
@@ -12,6 +12,9 @@ use App\Models\Base; @@ -12,6 +12,9 @@ use App\Models\Base;
12 */ 12 */
13 class BTemplate extends Base 13 class BTemplate extends Base
14 { 14 {
  15 + /**
  16 + * 模块类型
  17 + */
15 const SOURCE_HOME = 1;//首页 18 const SOURCE_HOME = 1;//首页
16 const SOURCE_PRODUCT = 2;//产品 19 const SOURCE_PRODUCT = 2;//产品
17 20
@@ -20,9 +23,16 @@ class BTemplate extends Base @@ -20,9 +23,16 @@ class BTemplate extends Base
20 const SOURCE_NEWS = 4;//新闻详情页 23 const SOURCE_NEWS = 4;//新闻详情页
21 const SOURCE_KEYWORD = 5;//聚合页 24 const SOURCE_KEYWORD = 5;//聚合页
22 const SOURCE_CUSTOM = 7;//自定义模块 25 const SOURCE_CUSTOM = 7;//自定义模块
  26 +
  27 + /**
  28 + * 拼接数据还是返回整个html
  29 + */
23 const ALL_HTML = 1;//无需拼接数据,获取整个html 30 const ALL_HTML = 1;//无需拼接数据,获取整个html
24 const PAGE_HTML = 0;//默认保存方式为0, 31 const PAGE_HTML = 0;//默认保存方式为0,
25 - const STATUS = 0; 32 +
  33 + /**
  34 + * 独立头部类型
  35 + */
26 const TYPE_HOME = 1;//首页类型 36 const TYPE_HOME = 1;//首页类型
27 const TYPE_PRODUCT_DETAIL = 2;//产品详情 37 const TYPE_PRODUCT_DETAIL = 2;//产品详情
28 const TYPE_PRODUCT_LIST = 3;//产品列表 38 const TYPE_PRODUCT_LIST = 3;//产品列表
@@ -31,13 +41,20 @@ class BTemplate extends Base @@ -31,13 +41,20 @@ class BTemplate extends Base
31 const TYPE_NEWS_DETAIL = 6;//新闻详情 41 const TYPE_NEWS_DETAIL = 6;//新闻详情
32 const TYPE_NEWS_LIST = 7;//新闻列表 42 const TYPE_NEWS_LIST = 7;//新闻列表
33 const TYPE_CUSTOM_PAGE = 8;//自定义页面 43 const TYPE_CUSTOM_PAGE = 8;//自定义页面
  44 + /**
  45 + * 其他相关定义
  46 + */
34 const IS_LIST = 1;//列表页 47 const IS_LIST = 1;//列表页
35 const IS_HEADER = 1;//独立头部底部 48 const IS_HEADER = 1;//独立头部底部
36 const IS_NO_HEADER = 0;//非独立头部底部 49 const IS_NO_HEADER = 0;//非独立头部底部
37 const IS_CUSTOM = 1;//为扩展模块 50 const IS_CUSTOM = 1;//为扩展模块
38 const IS_NO_CUSTOM = 0;//为默认模块 51 const IS_NO_CUSTOM = 0;//为默认模块
39 const IS_VISUALIZATION = 1;//定制项目 52 const IS_VISUALIZATION = 1;//定制项目
  53 + const STATUS = 0;
40 54
  55 + /**
  56 + * @var string
  57 + */
41 protected $table = 'gl_web_template'; 58 protected $table = 'gl_web_template';
42 //连接数据库 59 //连接数据库
43 protected $connection = 'custom_mysql'; 60 protected $connection = 'custom_mysql';