作者 lyh

gx头部底部代码

@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 namespace App\Http\Logic\Bside\BTemplate; 10 namespace App\Http\Logic\Bside\BTemplate;
11 11
12 use App\Http\Logic\Bside\BaseLogic; 12 use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\IsCom\ProjectComConfig;
13 use App\Models\Project\PageSetting; 14 use App\Models\Project\PageSetting;
14 use App\Models\Service\Service as ServiceSettingModel; 15 use App\Models\Service\Service as ServiceSettingModel;
15 use App\Models\Template\BTemplate; 16 use App\Models\Template\BTemplate;
@@ -158,30 +159,29 @@ class BTemplateLogLogic extends BaseLogic @@ -158,30 +159,29 @@ class BTemplateLogLogic extends BaseLogic
158 * @method :post 159 * @method :post
159 * @time :2023/10/21 17:29 160 * @time :2023/10/21 17:29
160 */ 161 */
161 - public function getType($source,$is_list,$is_custom = BTemplate::IS_NO_CUSTOM,$CommonType = BTemplate::COMMON_HEAD,$template_id = 0){  
162 - if($template_id == 0){//定制全为独立头部和底部  
163 - $type = $source;  
164 - return $this->success($type); 162 + public function getType($source,$is_list,$is_custom = BTemplate::IS_NO_CUSTOM,$commonType = BTemplate::COMMON_HEAD,$template_id = 0){
  163 + if($template_id == 0){
  164 + return $this->success($source);
165 } 165 }
166 $type = BTemplate::SOURCE_COM;//公共头部底部 166 $type = BTemplate::SOURCE_COM;//公共头部底部
167 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER; 167 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER;
168 - if($is_custom == BTemplate::IS_CUSTOM || $is_head == BTemplate::IS_NO_HEADER){//拓展模块为首页头部 168 + if($is_head == BTemplate::IS_NO_HEADER){//拓展模块为公共头+底
169 return $this->success($type); 169 return $this->success($type);
170 } 170 }
171 //查看页面是否设置自定义头部底部 171 //查看页面是否设置自定义头部底部
172 - $pageSettingModel = new PageSetting();  
173 - $pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id'],'type'=>$CommonType]);  
174 - if ($pageInfo === false) { 172 + $comConfigModel = new ProjectComConfig();
  173 + $configInfo = $comConfigModel->read(['source'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom]);
  174 + if($configInfo === false){
175 return $this->success($type); 175 return $this->success($type);
176 } 176 }
177 - if($source == BTemplate::SOURCE_HOME){if ($pageInfo['home'] != 0){$type = BTemplate::SOURCE_HOME;}}  
178 - if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::SOURCE_PRODUCT;}}  
179 - else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::SOURCE_PRODUCT;}}}  
180 - if ($source == BTemplate::SOURCE_BLOG) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::SOURCE_BLOG;}}  
181 - else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::SOURCE_BLOG;}}}  
182 - if ($source == BTemplate::SOURCE_NEWS) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::SOURCE_NEWS;}}  
183 - else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::SOURCE_NEWS;}}}  
184 - if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::TYPE_CUSTOM_PAGE;}} 177 + //头部
  178 + if($commonType == BTemplate::COMMON_HEAD){
  179 + return $this->success($configInfo['header_status'] == 0 ? $type : $source);
  180 + }
  181 + //底部
  182 + if($commonType == BTemplate::COMMON_FOOTER){
  183 + return $this->success($configInfo['footer_status'] == 0 ? $type : $source);
  184 + }
185 return $this->success($type); 185 return $this->success($type);
186 } 186 }
187 187
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 namespace App\Http\Logic\Bside\BTemplate; 10 namespace App\Http\Logic\Bside\BTemplate;
11 11
12 use App\Http\Logic\Bside\BaseLogic; 12 use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\IsCom\ProjectComConfig;
13 use App\Models\Project\PageSetting; 14 use App\Models\Project\PageSetting;
14 use App\Models\RouteMap\RouteMap; 15 use App\Models\RouteMap\RouteMap;
15 use App\Models\Service\Service as ServiceSettingModel; 16 use App\Models\Service\Service as ServiceSettingModel;
@@ -236,32 +237,31 @@ class InitHtmlLogic extends BaseLogic @@ -236,32 +237,31 @@ class InitHtmlLogic extends BaseLogic
236 * @method :post 237 * @method :post
237 * @time :2023/10/21 17:29 238 * @time :2023/10/21 17:29
238 */ 239 */
239 - public function getType($source,$is_list,$is_custom = BTemplate::IS_NO_CUSTOM,$CommonType = BTemplate::COMMON_HEAD,$template_id = 0){ 240 + public function getType($source,$is_list,$is_custom = BTemplate::IS_NO_CUSTOM,$commonType = BTemplate::COMMON_HEAD,$template_id = 0){
240 if($template_id == 0){ 241 if($template_id == 0){
241 return $this->success($source); 242 return $this->success($source);
242 } 243 }
243 $type = BTemplate::SOURCE_COM;//公共头部底部 244 $type = BTemplate::SOURCE_COM;//公共头部底部
244 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER; 245 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER;
245 - if($is_custom == BTemplate::IS_CUSTOM || $is_head == BTemplate::IS_NO_HEADER){//拓展模块为首页头部 246 + if($is_head == BTemplate::IS_NO_HEADER){//拓展模块为公共头+底
246 return $this->success($type); 247 return $this->success($type);
247 } 248 }
248 //查看页面是否设置自定义头部底部 249 //查看页面是否设置自定义头部底部
249 - $pageSettingModel = new PageSetting();  
250 - $pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id'],'type'=>$CommonType]);  
251 - if ($pageInfo === false) { 250 + $comConfigModel = new ProjectComConfig();
  251 + $configInfo = $comConfigModel->read(['source'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom]);
  252 + if($configInfo === false){
252 return $this->success($type); 253 return $this->success($type);
253 } 254 }
254 - if($source == BTemplate::SOURCE_HOME){if ($pageInfo['home'] != 0){$type = BTemplate::SOURCE_HOME;}}  
255 - if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::SOURCE_PRODUCT;}}  
256 - else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::SOURCE_PRODUCT;}}}  
257 - if ($source == BTemplate::SOURCE_BLOG) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::SOURCE_BLOG;}}  
258 - else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::SOURCE_BLOG;}}}  
259 - if ($source == BTemplate::SOURCE_NEWS) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::SOURCE_NEWS;}}  
260 - else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::SOURCE_NEWS;}}}  
261 - if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::SOURCE_KEYWORD;}} 255 + //头部
  256 + if($commonType == BTemplate::COMMON_HEAD){
  257 + return $this->success($configInfo['header_status'] == 0 ? $type : $source);
  258 + }
  259 + //底部
  260 + if($commonType == BTemplate::COMMON_FOOTER){
  261 + return $this->success($configInfo['footer_status'] == 0 ? $type : $source);
  262 + }
262 return $this->success($type); 263 return $this->success($type);
263 } 264 }
264 -  
265 /** 265 /**
266 * @remark :保存时字符串处理 266 * @remark :保存时字符串处理
267 * @name :handleCommonParam 267 * @name :handleCommonParam