|
@@ -162,56 +162,58 @@ class BTemplateLogic extends BaseLogic |
|
@@ -162,56 +162,58 @@ class BTemplateLogic extends BaseLogic |
|
162
|
//获取首页公共的头部和底部
|
162
|
//获取首页公共的头部和底部
|
|
163
|
$commonTemplateModel = new BTemplateCommon();
|
163
|
$commonTemplateModel = new BTemplateCommon();
|
|
164
|
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>1]);
|
164
|
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>1]);
|
|
165
|
- //查看页面是否设置自定义头部底部
|
|
|
|
166
|
- $pageSettingModel = new PageSetting();
|
|
|
|
167
|
- $pageInfo = $pageSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
168
|
- if($pageInfo != false){
|
|
|
|
169
|
- $commonTemplateModel = new BTemplateCommon();
|
|
|
|
170
|
- if($source == 2){//产品页
|
|
|
|
171
|
- if($source_id != 0){//产品详情页
|
|
|
|
172
|
- if($pageInfo['product_list'] != 0){
|
|
|
|
173
|
- //使用独立头和底
|
|
|
|
174
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>3]);
|
|
|
|
175
|
- }
|
|
|
|
176
|
- }else{//产品列表页
|
|
|
|
177
|
- if($pageInfo['product_details'] != 0){
|
|
|
|
178
|
- //使用独立头和底
|
|
|
|
179
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>2]);
|
165
|
+ if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
|
|
|
|
166
|
+ //查看页面是否设置自定义头部底部
|
|
|
|
167
|
+ $pageSettingModel = new PageSetting();
|
|
|
|
168
|
+ $pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
|
|
|
|
169
|
+ if ($pageInfo != false) {
|
|
|
|
170
|
+ $commonTemplateModel = new BTemplateCommon();
|
|
|
|
171
|
+ if ($source == 2) {//产品页
|
|
|
|
172
|
+ if ($source_id != 0) {//产品详情页
|
|
|
|
173
|
+ if ($pageInfo['product_list'] != 0) {
|
|
|
|
174
|
+ //使用独立头和底
|
|
|
|
175
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 3]);
|
|
|
|
176
|
+ }
|
|
|
|
177
|
+ } else {//产品列表页
|
|
|
|
178
|
+ if ($pageInfo['product_details'] != 0) {
|
|
|
|
179
|
+ //使用独立头和底
|
|
|
|
180
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 2]);
|
|
|
|
181
|
+ }
|
|
180
|
}
|
182
|
}
|
|
181
|
}
|
183
|
}
|
|
182
|
- }
|
|
|
|
183
|
- if($source == 3){//博客页
|
|
|
|
184
|
- if($source_id != 0){//博客详情页
|
|
|
|
185
|
- if($pageInfo['blog_lists'] != 0){
|
|
|
|
186
|
- //使用独立头和底
|
|
|
|
187
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>4]);
|
|
|
|
188
|
- }
|
|
|
|
189
|
- }else{//产品列表页
|
|
|
|
190
|
- if($pageInfo['blog_details'] != 0){
|
|
|
|
191
|
- //使用独立头和底
|
|
|
|
192
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>5]);
|
184
|
+ if ($source == 3) {//博客页
|
|
|
|
185
|
+ if ($source_id != 0) {//博客详情页
|
|
|
|
186
|
+ if ($pageInfo['blog_lists'] != 0) {
|
|
|
|
187
|
+ //使用独立头和底
|
|
|
|
188
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 4]);
|
|
|
|
189
|
+ }
|
|
|
|
190
|
+ } else {//产品列表页
|
|
|
|
191
|
+ if ($pageInfo['blog_details'] != 0) {
|
|
|
|
192
|
+ //使用独立头和底
|
|
|
|
193
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 5]);
|
|
|
|
194
|
+ }
|
|
193
|
}
|
195
|
}
|
|
194
|
}
|
196
|
}
|
|
195
|
- }
|
|
|
|
196
|
- if($source == 4){//新闻页
|
|
|
|
197
|
- if($source_id != 0){//新闻详情页
|
|
|
|
198
|
- if($pageInfo['news_lists'] != 0){
|
|
|
|
199
|
- //使用独立头和底
|
|
|
|
200
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>6]);
|
197
|
+ if ($source == 4) {//新闻页
|
|
|
|
198
|
+ if ($source_id != 0) {//新闻详情页
|
|
|
|
199
|
+ if ($pageInfo['news_lists'] != 0) {
|
|
|
|
200
|
+ //使用独立头和底
|
|
|
|
201
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 6]);
|
|
|
|
202
|
+ }
|
|
|
|
203
|
+ } else {//新闻列表页
|
|
|
|
204
|
+ if ($pageInfo['news_details'] != 0) {
|
|
|
|
205
|
+ //使用独立头和底
|
|
|
|
206
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 7]);
|
|
|
|
207
|
+ }
|
|
201
|
}
|
208
|
}
|
|
202
|
- }else{//新闻列表页
|
|
|
|
203
|
- if($pageInfo['news_details'] != 0){
|
209
|
+ }
|
|
|
|
210
|
+ if ($source == 5) {//聚合页
|
|
|
|
211
|
+ if ($pageInfo['polymerization'] != 0) {
|
|
204
|
//使用独立头和底
|
212
|
//使用独立头和底
|
|
205
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>7]);
|
213
|
+ $commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 8]);
|
|
206
|
}
|
214
|
}
|
|
207
|
}
|
215
|
}
|
|
208
|
}
|
216
|
}
|
|
209
|
- if($source == 5){//聚合页
|
|
|
|
210
|
- if($pageInfo['polymerization'] != 0){
|
|
|
|
211
|
- //使用独立头和底
|
|
|
|
212
|
- $commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>8]);
|
|
|
|
213
|
- }
|
|
|
|
214
|
- }
|
|
|
|
215
|
}
|
217
|
}
|
|
216
|
return $commonInfo;
|
218
|
return $commonInfo;
|
|
217
|
}
|
219
|
}
|
|
@@ -319,45 +321,47 @@ class BTemplateLogic extends BaseLogic |
|
@@ -319,45 +321,47 @@ class BTemplateLogic extends BaseLogic |
|
319
|
public function getType($source,$source_id){
|
321
|
public function getType($source,$source_id){
|
|
320
|
$type = 1;//首页公共头部底部
|
322
|
$type = 1;//首页公共头部底部
|
|
321
|
//查看页面是否设置自定义头部底部
|
323
|
//查看页面是否设置自定义头部底部
|
|
322
|
- $pageSettingModel = new PageSetting();
|
|
|
|
323
|
- $pageInfo = $pageSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
324
|
- if($pageInfo !== false){
|
|
|
|
325
|
- if($source == 2){
|
|
|
|
326
|
- if($source_id != 0){
|
|
|
|
327
|
- if($pageInfo['product_list'] != 0){
|
|
|
|
328
|
- $type = 3;
|
|
|
|
329
|
- }
|
|
|
|
330
|
- }else{
|
|
|
|
331
|
- if($pageInfo['product_details'] != 0){
|
|
|
|
332
|
- $type = 2;
|
324
|
+ if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
|
|
|
|
325
|
+ $pageSettingModel = new PageSetting();
|
|
|
|
326
|
+ $pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
|
|
|
|
327
|
+ if ($pageInfo !== false) {
|
|
|
|
328
|
+ if ($source == 2) {
|
|
|
|
329
|
+ if ($source_id != 0) {
|
|
|
|
330
|
+ if ($pageInfo['product_list'] != 0) {
|
|
|
|
331
|
+ $type = 3;
|
|
|
|
332
|
+ }
|
|
|
|
333
|
+ } else {
|
|
|
|
334
|
+ if ($pageInfo['product_details'] != 0) {
|
|
|
|
335
|
+ $type = 2;
|
|
|
|
336
|
+ }
|
|
333
|
}
|
337
|
}
|
|
334
|
}
|
338
|
}
|
|
335
|
- }
|
|
|
|
336
|
- if($source == 3){
|
|
|
|
337
|
- if($source_id != 0){
|
|
|
|
338
|
- if($pageInfo['blog_list'] != 0){
|
|
|
|
339
|
- $type = 4;
|
|
|
|
340
|
- }
|
|
|
|
341
|
- }else{
|
|
|
|
342
|
- if($pageInfo['blog_details'] != 0){
|
|
|
|
343
|
- $type = 5;
|
339
|
+ if ($source == 3) {
|
|
|
|
340
|
+ if ($source_id != 0) {
|
|
|
|
341
|
+ if ($pageInfo['blog_list'] != 0) {
|
|
|
|
342
|
+ $type = 4;
|
|
|
|
343
|
+ }
|
|
|
|
344
|
+ } else {
|
|
|
|
345
|
+ if ($pageInfo['blog_details'] != 0) {
|
|
|
|
346
|
+ $type = 5;
|
|
|
|
347
|
+ }
|
|
344
|
}
|
348
|
}
|
|
345
|
}
|
349
|
}
|
|
346
|
- }
|
|
|
|
347
|
- if($source == 4){
|
|
|
|
348
|
- if($source_id != 0){
|
|
|
|
349
|
- if($pageInfo['news_list'] != 0){
|
|
|
|
350
|
- $type = 6;
|
|
|
|
351
|
- }
|
|
|
|
352
|
- }else{
|
|
|
|
353
|
- if($pageInfo['news_details'] != 0){
|
|
|
|
354
|
- $type = 7;
|
350
|
+ if ($source == 4) {
|
|
|
|
351
|
+ if ($source_id != 0) {
|
|
|
|
352
|
+ if ($pageInfo['news_list'] != 0) {
|
|
|
|
353
|
+ $type = 6;
|
|
|
|
354
|
+ }
|
|
|
|
355
|
+ } else {
|
|
|
|
356
|
+ if ($pageInfo['news_details'] != 0) {
|
|
|
|
357
|
+ $type = 7;
|
|
|
|
358
|
+ }
|
|
355
|
}
|
359
|
}
|
|
356
|
}
|
360
|
}
|
|
357
|
- }
|
|
|
|
358
|
- if($source == 5){
|
|
|
|
359
|
- if($pageInfo['polymerization'] != 0){
|
|
|
|
360
|
- $type = 8;
|
361
|
+ if ($source == 5) {
|
|
|
|
362
|
+ if ($pageInfo['polymerization'] != 0) {
|
|
|
|
363
|
+ $type = 8;
|
|
|
|
364
|
+ }
|
|
361
|
}
|
365
|
}
|
|
362
|
}
|
366
|
}
|
|
363
|
}
|
367
|
}
|