作者 lyh

gx

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