作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

@@ -31,12 +31,16 @@ class ReplaceHtmlController extends BaseController @@ -31,12 +31,16 @@ class ReplaceHtmlController extends BaseController
31 'type'=>'required', 31 'type'=>'required',
32 'is_list'=>'required', 32 'is_list'=>'required',
33 'is_custom'=>'required', 33 'is_custom'=>'required',
  34 + 'project_id'=>'required',
  35 + 'template_id'=>'required',
34 ],[ 36 ],[
35 'old_html.required' => '需替换的html不能为空', 37 'old_html.required' => '需替换的html不能为空',
36 'html.required' => 'html不能为空', 38 'html.required' => 'html不能为空',
37 'type.required' => '类型type不能为空', 39 'type.required' => '类型type不能为空',
38 'is_custom.required' => '类型is_custom不能为空', 40 'is_custom.required' => '类型is_custom不能为空',
39 'is_list.required' => '类型is_list不能为空', 41 'is_list.required' => '类型is_list不能为空',
  42 + 'project_id.required' => 'project_id不能为空',
  43 + 'template_id.required' => '模版id不能为空',
40 ]); 44 ]);
41 $logic->replaceHtml(); 45 $logic->replaceHtml();
42 $this->response('success'); 46 $this->response('success');
@@ -26,6 +26,39 @@ class ReplaceHtmlLogic extends BaseLogic @@ -26,6 +26,39 @@ class ReplaceHtmlLogic extends BaseLogic
26 } 26 }
27 27
28 /** 28 /**
  29 + * @remark :定制页面头部类型---根据source获取type类型
  30 + * @name :getType
  31 + * @author :lyh
  32 + * @method :post
  33 + * @time :2023/11/16 11:20
  34 + */
  35 + public function getCustomizedType($source,$is_list){
  36 + $type = BTemplate::TYPE_HOME;
  37 + if($source == BTemplate::SOURCE_PRODUCT){
  38 + if($is_list == BTemplate::IS_LIST){
  39 + $type = BTemplate::TYPE_PRODUCT_LIST;
  40 + }else{
  41 + $type = BTemplate::TYPE_PRODUCT_DETAIL;
  42 + }
  43 + }
  44 + if($source == BTemplate::SOURCE_BLOG){
  45 + if($is_list == BTemplate::IS_LIST){
  46 + $type = BTemplate::TYPE_BLOG_LIST;
  47 + }else{
  48 + $type = BTemplate::TYPE_BLOG_DETAIL;
  49 + }
  50 + }
  51 + if($source == BTemplate::SOURCE_NEWS){
  52 + if($is_list == BTemplate::IS_LIST){
  53 + $type = BTemplate::TYPE_NEWS_LIST;
  54 + }else{
  55 + $type = BTemplate::TYPE_NEWS_DETAIL;
  56 + }
  57 + }
  58 + return $type;
  59 + }
  60 +
  61 + /**
29 * @remark :替换可视化的html代码(按类型) 62 * @remark :替换可视化的html代码(按类型)
30 * @name :replaceHtml 63 * @name :replaceHtml
31 * @author :lyh 64 * @author :lyh
@@ -34,15 +67,9 @@ class ReplaceHtmlLogic extends BaseLogic @@ -34,15 +67,9 @@ class ReplaceHtmlLogic extends BaseLogic
34 */ 67 */
35 public function replaceHtml(){ 68 public function replaceHtml(){
36 ProjectServer::useProject($this->param['project_id']); 69 ProjectServer::useProject($this->param['project_id']);
37 - $type = $this->getCustomizedType($this->param['type'], $this->param['is_list']);//获取定制界面类型  
38 - //查看当前页面是否定制,是否开启可视化  
39 - $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面  
40 - if (in_array($type, $page_array)) {//当前页面是定制界面  
41 - $this->param['template_id'] = 0;  
42 - }  
43 - $replaceId = $this->saveReplaceHtml($this->param);  
44 //TODO::生成一条任务记录 70 //TODO::生成一条任务记录
45 - //查询当前所有装修的 71 + $replaceId = $this->saveReplaceHtml($this->param);
  72 + //查询当前类型所有装修的记录
46 $condition = ['source'=>$this->param['type'],'is_custom'=>$this->param['is_custom'],'is_list'=>$this->param['is_list'], 73 $condition = ['source'=>$this->param['type'],'is_custom'=>$this->param['is_custom'],'is_list'=>$this->param['is_list'],
47 'template_id'=>$this->param['template_id']]; 74 'template_id'=>$this->param['template_id']];
48 $list = $this->model->list($condition); 75 $list = $this->model->list($condition);