|
...
|
...
|
@@ -7,6 +7,7 @@ use App\Models\Blog\BlogCategory; |
|
|
|
use App\Models\News\NewsCategory;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
|
|
use App\Models\Template\ModuleSetting;
|
|
|
|
use App\Models\Template\Template;
|
|
|
|
use App\Models\Template\BSetting;
|
|
...
|
...
|
@@ -115,13 +116,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
if($info === false){
|
|
|
|
//字符串截取
|
|
|
|
$this->StringProcessing();
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
//获取模板详情
|
|
|
|
$ATemplateModel = new Template();
|
|
|
|
$TemplateInfo = $ATemplateModel->read(['id'=>$this->param['template_id']]);
|
|
|
|
//同步数据
|
|
|
|
$this->param['name'] = $TemplateInfo['name'];
|
|
|
|
$this->param['image'] = $TemplateInfo['image'];
|
|
|
|
$this->templateSaveParam($this->param['template_id']);
|
|
|
|
$rs = $this->model->add($this->param);
|
|
|
|
}else{
|
|
|
|
$this->StringProcessing();
|
|
...
|
...
|
@@ -134,6 +129,36 @@ class BTemplateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :处理保存模版数据
|
|
|
|
* @name :templateParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/21 16:30
|
|
|
|
*/
|
|
|
|
public function templateSaveParam($template_id){
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
//获取模板详情
|
|
|
|
$ATemplateModel = new Template();
|
|
|
|
$TemplateInfo = $ATemplateModel->read(['id'=>$template_id]);
|
|
|
|
//同步数据
|
|
|
|
$this->param['name'] = $TemplateInfo['name'];
|
|
|
|
$this->param['image'] = $TemplateInfo['image'];
|
|
|
|
//获取公共主题头部底部
|
|
|
|
$serviceSettingModel = new ServiceSettingModel();
|
|
|
|
$list = $serviceSettingModel->list(['type'=>2],'created_at');
|
|
|
|
//拼接html
|
|
|
|
foreach ($list as $k => $v){
|
|
|
|
if($v['key'] == 'head'){
|
|
|
|
$this->param['html'] = $v['values'].$this->param['html'];
|
|
|
|
}
|
|
|
|
if($v['key'] == 'footer'){
|
|
|
|
$this->param['html'] = $this->param['html'].$v['values'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :字符串处理
|
|
|
|
* @name :StringProcessing
|
|
|
|
* @author :lyh
|
...
|
...
|
|