作者 lyh

gx

@@ -113,7 +113,10 @@ class CustomTemplateLogic extends BaseLogic @@ -113,7 +113,10 @@ class CustomTemplateLogic extends BaseLogic
113 public function saveCommonTemplate($param){ 113 public function saveCommonTemplate($param){
114 $type = $this->getType(); 114 $type = $this->getType();
115 $templateCommonModel = new BTemplateCommon(); 115 $templateCommonModel = new BTemplateCommon();
116 - $info = $templateCommonModel->read(['template_id'=>$param['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]); 116 + //获取设置的默认模版
  117 + $bSettingModel = new Setting();
  118 + $bSettingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
  119 + $info = $templateCommonModel->read(['template_id'=>$bSettingInfo['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]);
117 $data = [ 120 $data = [
118 'head_html'=>$param['head_html'], 121 'head_html'=>$param['head_html'],
119 'head_css'=>$param['head_css'], 122 'head_css'=>$param['head_css'],
@@ -122,7 +125,7 @@ class CustomTemplateLogic extends BaseLogic @@ -122,7 +125,7 @@ class CustomTemplateLogic extends BaseLogic
122 'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")), 125 'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")),
123 ]; 126 ];
124 if($info === false){ 127 if($info === false){
125 - $data['template_id'] = $param['template_id']; 128 + $data['template_id'] = $bSettingInfo['template_id'];
126 $data['project_id'] = $this->user['project_id']; 129 $data['project_id'] = $this->user['project_id'];
127 $data['type'] = $type; 130 $data['type'] = $type;
128 $templateCommonModel->add($data); 131 $templateCommonModel->add($data);