|
@@ -207,26 +207,26 @@ class ATemplateLogic extends BaseLogic |
|
@@ -207,26 +207,26 @@ class ATemplateLogic extends BaseLogic |
|
207
|
$info = $bTemplateModel->read(['source'=>1,'template_id'=>$template_id]);
|
207
|
$info = $bTemplateModel->read(['source'=>1,'template_id'=>$template_id]);
|
|
208
|
if($info === false){
|
208
|
if($info === false){
|
|
209
|
$data = [
|
209
|
$data = [
|
|
210
|
- 'source'=>1, 'source_id'=>0, 'template_id'=>$template_id, 'main_html'=>$templateInfo['main_html'],
|
210
|
+ 'source'=>BTemplate::SOURCE_COM, 'source_id'=>0, 'template_id'=>$template_id, 'main_html'=>$templateInfo['main_html'],
|
|
211
|
'main_css'=>$templateInfo['main_css'], 'project_id'=>$project_id,
|
211
|
'main_css'=>$templateInfo['main_css'], 'project_id'=>$project_id,
|
|
212
|
];
|
212
|
];
|
|
213
|
$bTemplateModel->add($data);
|
213
|
$bTemplateModel->add($data);
|
|
214
|
}
|
214
|
}
|
|
215
|
//保存一次公共头部+底部+other信息
|
215
|
//保存一次公共头部+底部+other信息
|
|
216
|
$bComTemplateModel = new BTemplateCom();
|
216
|
$bComTemplateModel = new BTemplateCom();
|
|
217
|
- $condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_HEAD,'source'=>BTemplate::SOURCE_HOME];
|
217
|
+ $condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_HEAD,'source'=>BTemplate::SOURCE_COM];
|
|
218
|
$headInfo = $bComTemplateModel->read($condition);
|
218
|
$headInfo = $bComTemplateModel->read($condition);
|
|
219
|
if($headInfo === false){
|
219
|
if($headInfo === false){
|
|
220
|
$headData = ['html'=>$templateInfo['head_html'], 'html_style'=>$templateInfo['head_css'], 'project_id'=>$project_id];
|
220
|
$headData = ['html'=>$templateInfo['head_html'], 'html_style'=>$templateInfo['head_css'], 'project_id'=>$project_id];
|
|
221
|
$bComTemplateModel->add(array_merge($condition,$headData));
|
221
|
$bComTemplateModel->add(array_merge($condition,$headData));
|
|
222
|
}
|
222
|
}
|
|
223
|
- $condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_FOOTER,'source'=>BTemplate::SOURCE_HOME];
|
223
|
+ $condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_FOOTER,'source'=>BTemplate::SOURCE_COM];
|
|
224
|
$footerInfo = $bComTemplateModel->read($condition);
|
224
|
$footerInfo = $bComTemplateModel->read($condition);
|
|
225
|
if($footerInfo === false){
|
225
|
if($footerInfo === false){
|
|
226
|
$footerData = ['html'=>$templateInfo['head_html'], 'html_style'=>$templateInfo['head_css'], 'project_id'=>$project_id];
|
226
|
$footerData = ['html'=>$templateInfo['head_html'], 'html_style'=>$templateInfo['head_css'], 'project_id'=>$project_id];
|
|
227
|
$bComTemplateModel->add(array_merge($condition,$footerData));
|
227
|
$bComTemplateModel->add(array_merge($condition,$footerData));
|
|
228
|
}
|
228
|
}
|
|
229
|
- $condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_OTHER,'source'=>BTemplate::SOURCE_HOME];
|
229
|
+ $condition = ['template_id'=>$template_id,'common_type'=>BTemplate::COMMON_OTHER,'source'=>BTemplate::SOURCE_COM];
|
|
230
|
$footerInfo = $bComTemplateModel->read($condition);
|
230
|
$footerInfo = $bComTemplateModel->read($condition);
|
|
231
|
if($footerInfo === false){
|
231
|
if($footerInfo === false){
|
|
232
|
$other = str_replace('<header','',characterTruncation($templateInfo['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s"));
|
232
|
$other = str_replace('<header','',characterTruncation($templateInfo['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s"));
|