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