|
@@ -7,6 +7,7 @@ use App\Models\Blog\BlogCategory; |
|
@@ -7,6 +7,7 @@ use App\Models\Blog\BlogCategory; |
|
7
|
use App\Models\News\NewsCategory;
|
7
|
use App\Models\News\NewsCategory;
|
|
8
|
use App\Models\Product\Category;
|
8
|
use App\Models\Product\Category;
|
|
9
|
use App\Models\Product\Product;
|
9
|
use App\Models\Product\Product;
|
|
|
|
10
|
+use App\Models\Service\Service as ServiceSettingModel;
|
|
10
|
use App\Models\Template\ModuleSetting;
|
11
|
use App\Models\Template\ModuleSetting;
|
|
11
|
use App\Models\Template\Template;
|
12
|
use App\Models\Template\Template;
|
|
12
|
use App\Models\Template\BSetting;
|
13
|
use App\Models\Template\BSetting;
|
|
@@ -115,13 +116,7 @@ class BTemplateLogic extends BaseLogic |
|
@@ -115,13 +116,7 @@ class BTemplateLogic extends BaseLogic |
|
115
|
if($info === false){
|
116
|
if($info === false){
|
|
116
|
//字符串截取
|
117
|
//字符串截取
|
|
117
|
$this->StringProcessing();
|
118
|
$this->StringProcessing();
|
|
118
|
- $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
119
|
- //获取模板详情
|
|
|
|
120
|
- $ATemplateModel = new Template();
|
|
|
|
121
|
- $TemplateInfo = $ATemplateModel->read(['id'=>$this->param['template_id']]);
|
|
|
|
122
|
- //同步数据
|
|
|
|
123
|
- $this->param['name'] = $TemplateInfo['name'];
|
|
|
|
124
|
- $this->param['image'] = $TemplateInfo['image'];
|
119
|
+ $this->templateSaveParam($this->param['template_id']);
|
|
125
|
$rs = $this->model->add($this->param);
|
120
|
$rs = $this->model->add($this->param);
|
|
126
|
}else{
|
121
|
}else{
|
|
127
|
$this->StringProcessing();
|
122
|
$this->StringProcessing();
|
|
@@ -134,6 +129,36 @@ class BTemplateLogic extends BaseLogic |
|
@@ -134,6 +129,36 @@ class BTemplateLogic extends BaseLogic |
|
134
|
}
|
129
|
}
|
|
135
|
|
130
|
|
|
136
|
/**
|
131
|
/**
|
|
|
|
132
|
+ * @remark :处理保存模版数据
|
|
|
|
133
|
+ * @name :templateParam
|
|
|
|
134
|
+ * @author :lyh
|
|
|
|
135
|
+ * @method :post
|
|
|
|
136
|
+ * @time :2023/7/21 16:30
|
|
|
|
137
|
+ */
|
|
|
|
138
|
+ public function templateSaveParam($template_id){
|
|
|
|
139
|
+ $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
140
|
+ //获取模板详情
|
|
|
|
141
|
+ $ATemplateModel = new Template();
|
|
|
|
142
|
+ $TemplateInfo = $ATemplateModel->read(['id'=>$template_id]);
|
|
|
|
143
|
+ //同步数据
|
|
|
|
144
|
+ $this->param['name'] = $TemplateInfo['name'];
|
|
|
|
145
|
+ $this->param['image'] = $TemplateInfo['image'];
|
|
|
|
146
|
+ //获取公共主题头部底部
|
|
|
|
147
|
+ $serviceSettingModel = new ServiceSettingModel();
|
|
|
|
148
|
+ $list = $serviceSettingModel->list(['type'=>2],'created_at');
|
|
|
|
149
|
+ //拼接html
|
|
|
|
150
|
+ foreach ($list as $k => $v){
|
|
|
|
151
|
+ if($v['key'] == 'head'){
|
|
|
|
152
|
+ $this->param['html'] = $v['values'].$this->param['html'];
|
|
|
|
153
|
+ }
|
|
|
|
154
|
+ if($v['key'] == 'footer'){
|
|
|
|
155
|
+ $this->param['html'] = $this->param['html'].$v['values'];
|
|
|
|
156
|
+ }
|
|
|
|
157
|
+ }
|
|
|
|
158
|
+ return true;
|
|
|
|
159
|
+ }
|
|
|
|
160
|
+
|
|
|
|
161
|
+ /**
|
|
137
|
* @remark :字符串处理
|
162
|
* @remark :字符串处理
|
|
138
|
* @name :StringProcessing
|
163
|
* @name :StringProcessing
|
|
139
|
* @author :lyh
|
164
|
* @author :lyh
|