作者 张关杰

gx

@@ -915,4 +915,34 @@ class BTemplateLogic extends BaseLogic @@ -915,4 +915,34 @@ class BTemplateLogic extends BaseLogic
915 } 915 }
916 return $this->success(); 916 return $this->success();
917 } 917 }
  918 +
  919 + /**
  920 + * @remark :替换可视化的html代码(按类型)
  921 + * @name :replaceHtml
  922 + * @author :lyh
  923 + * @method :post
  924 + * @time :2024/5/7 15:52
  925 + */
  926 + public function replaceHtml(){
  927 + //查询当前所有装修的
  928 + $condition = ['source'=>$this->param['type'],'is_custom'=>$this->param['is_custom'],'is_list'=>$this->param['is_list'],
  929 + 'template_id'=>$this->param['template_id']];
  930 + $list = $this->model->list($condition);
  931 + foreach ($list as $v){
  932 + $main_html = str_replace($this->param['old_html'],$this->param['html'],$v['main_html']);
  933 + $this->model->edit(['main_html'=>$main_html],['id'=>$v['id']]);
  934 + //写入日志
  935 + $logData = [
  936 + 'old_html'=>$v['main_html'],
  937 + 'html'=>$main_html,
  938 + 'type'=>$v['type'],
  939 + 'is_custom'=>$v['is_custom'],
  940 + 'is_list'=>$v['is_list'],
  941 + 'mid'=>$v['id'],
  942 + 'uid'=>$this->user['manager_id'],
  943 + ];
  944 + //TODO::执行添加记录
  945 + }
  946 + return $this->success();
  947 + }
918 } 948 }