|
...
|
...
|
@@ -207,26 +207,26 @@ class ATemplateLogic extends BaseLogic |
|
|
|
$info = $bTemplateModel->read(['source'=>1,'template_id'=>$template_id]);
|
|
|
|
if($info === false){
|
|
|
|
$data = [
|
|
|
|
'source'=>1, 'source_id'=>0, 'template_id'=>$template_id, 'main_html'=>$templateInfo['main_html'],
|
|
|
|
'source'=>BTemplate::SOURCE_COM, 'source_id'=>0, 'template_id'=>$template_id, 'main_html'=>$templateInfo['main_html'],
|
|
|
|
'main_css'=>$templateInfo['main_css'], 'project_id'=>$project_id,
|
|
|
|
];
|
|
|
|
$bTemplateModel->add($data);
|
|
|
|
}
|
|
|
|
//保存一次公共头部+底部+other信息
|
|
|
|
$bComTemplateModel = new BTemplateCom();
|
|
|
|
$condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_HEAD,'source'=>BTemplate::SOURCE_HOME];
|
|
|
|
$condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_HEAD,'source'=>BTemplate::SOURCE_COM];
|
|
|
|
$headInfo = $bComTemplateModel->read($condition);
|
|
|
|
if($headInfo === false){
|
|
|
|
$headData = ['html'=>$templateInfo['head_html'], 'html_style'=>$templateInfo['head_css'], 'project_id'=>$project_id];
|
|
|
|
$bComTemplateModel->add(array_merge($condition,$headData));
|
|
|
|
}
|
|
|
|
$condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_FOOTER,'source'=>BTemplate::SOURCE_HOME];
|
|
|
|
$condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_FOOTER,'source'=>BTemplate::SOURCE_COM];
|
|
|
|
$footerInfo = $bComTemplateModel->read($condition);
|
|
|
|
if($footerInfo === false){
|
|
|
|
$footerData = ['html'=>$templateInfo['head_html'], 'html_style'=>$templateInfo['head_css'], 'project_id'=>$project_id];
|
|
|
|
$bComTemplateModel->add(array_merge($condition,$footerData));
|
|
|
|
}
|
|
|
|
$condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_OTHER,'source'=>BTemplate::SOURCE_HOME];
|
|
|
|
$condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_OTHER,'source'=>BTemplate::SOURCE_COM];
|
|
|
|
$footerInfo = $bComTemplateModel->read($condition);
|
|
|
|
if($footerInfo === false){
|
|
|
|
$other = str_replace('<header','',characterTruncation($templateInfo['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s"));
|
...
|
...
|
|