|
@@ -97,6 +97,12 @@ class BTemplateLogic extends BaseLogic |
|
@@ -97,6 +97,12 @@ class BTemplateLogic extends BaseLogic |
|
97
|
//获取模板详情
|
97
|
//获取模板详情
|
|
98
|
$ATemplateModel = new Template();
|
98
|
$ATemplateModel = new Template();
|
|
99
|
$TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]);
|
99
|
$TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]);
|
|
|
|
100
|
+ }else{
|
|
|
|
101
|
+ //渲染首页数据
|
|
|
|
102
|
+ $ATemplateModel = new Template();
|
|
|
|
103
|
+ $ATemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]);
|
|
|
|
104
|
+ $TemplateInfo['name'] = $ATemplateInfo['name'];
|
|
|
|
105
|
+ $TemplateInfo['image_link'] = $this->getImageUrl($ATemplateInfo['image']);
|
|
100
|
}
|
106
|
}
|
|
101
|
$TemplateInfo['html'] = $this->getHeadFooter($TemplateInfo['html']);
|
107
|
$TemplateInfo['html'] = $this->getHeadFooter($TemplateInfo['html']);
|
|
102
|
return $this->success($TemplateInfo);
|
108
|
return $this->success($TemplateInfo);
|
|
@@ -192,12 +198,6 @@ class BTemplateLogic extends BaseLogic |
|
@@ -192,12 +198,6 @@ class BTemplateLogic extends BaseLogic |
|
192
|
*/
|
198
|
*/
|
|
193
|
public function templateSaveParam($template_id){
|
199
|
public function templateSaveParam($template_id){
|
|
194
|
$this->param['project_id'] = $this->user['project_id'];
|
200
|
$this->param['project_id'] = $this->user['project_id'];
|
|
195
|
- //获取模板详情
|
|
|
|
196
|
- $ATemplateModel = new Template();
|
|
|
|
197
|
- $TemplateInfo = $ATemplateModel->read(['id'=>$template_id]);
|
|
|
|
198
|
- //同步数据
|
|
|
|
199
|
- $this->param['name'] = $TemplateInfo['name'];
|
|
|
|
200
|
- $this->param['image'] = $TemplateInfo['image'];
|
|
|
|
201
|
if($this->param['source'] == 1){//首页
|
201
|
if($this->param['source'] == 1){//首页
|
|
202
|
$this->param['html'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/footer>/s');
|
202
|
$this->param['html'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/footer>/s');
|
|
203
|
}else{
|
203
|
}else{
|
|
@@ -313,9 +313,13 @@ class BTemplateLogic extends BaseLogic |
|
@@ -313,9 +313,13 @@ class BTemplateLogic extends BaseLogic |
|
313
|
]
|
313
|
]
|
|
314
|
];
|
314
|
];
|
|
315
|
//产品,新闻,博客,一级分类数据
|
315
|
//产品,新闻,博客,一级分类数据
|
|
316
|
- $productCategory = Category::where("pid",0)->get();
|
|
|
|
317
|
- $newCategory = NewsCategory::where("pid",0)->get();
|
|
|
|
318
|
- $blogCategory = BlogCategory::where("pid",0)->get();
|
316
|
+ $map = [
|
|
|
|
317
|
+ 'pid'=>0,
|
|
|
|
318
|
+ 'project_id'=>$this->user['project_id']
|
|
|
|
319
|
+ ];
|
|
|
|
320
|
+ $productCategory = Category::where($map)->get();
|
|
|
|
321
|
+ $newCategory = NewsCategory::where($map)->get();
|
|
|
|
322
|
+ $blogCategory = BlogCategory::where($map)->get();
|
|
319
|
if (!empty($productCategory)){
|
323
|
if (!empty($productCategory)){
|
|
320
|
foreach ($productCategory as $item){
|
324
|
foreach ($productCategory as $item){
|
|
321
|
$data["products"]["category"][] =$item;
|
325
|
$data["products"]["category"][] =$item;
|