From e1763d5749bcf80db3385d9dfe8d2aac8c188cdb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Jul 2024 16:48:02 +0800 Subject: [PATCH] demo --- .../app/controller/frontend/DetailController.php | 45 +- .../website/1/zh/deshi.neicela.com/about.html | 852 +++++++++------------ .../website/1/zh/deshi.neicela.com/contact.html | 716 ++++++++--------- .../website/1/zh/deshi.neicela.com/footer.html | 64 ++ .../website/1/zh/deshi.neicela.com/header.html | 76 ++ .../website/1/zh/deshi.neicela.com/index.html | 376 +-------- .../website/1/zh/deshi.neicela.com/news.html | 472 ++++-------- .../website/1/zh/deshi.neicela.com/newsDetail.html | 354 +++------ .../website/1/zh/deshi.neicela.com/product.html | 470 +++--------- .../1/zh/deshi.neicela.com/productDetail.html | 640 +++++----------- 10 files changed, 1399 insertions(+), 2666 deletions(-) create mode 100644 HuoCMS_close_source/public/themes/website/1/zh/deshi.neicela.com/footer.html create mode 100644 HuoCMS_close_source/public/themes/website/1/zh/deshi.neicela.com/header.html diff --git a/HuoCMS_close_source/app/controller/frontend/DetailController.php b/HuoCMS_close_source/app/controller/frontend/DetailController.php index d0926c3..e760722 100644 --- a/HuoCMS_close_source/app/controller/frontend/DetailController.php +++ b/HuoCMS_close_source/app/controller/frontend/DetailController.php @@ -1,5 +1,6 @@ sellerId.'_'.$this->siteId.'_'.$this->lang.'_'. $cid ; + $cateCacheKey = 'hc_detail_cate_' . $this->sellerId . '_' . $this->siteId . '_' . $this->lang . '_' . $cid; $category = cache($cateCacheKey); - if(empty($category)){ + if (empty($category)) { try { - $category = $Category->getCategory(['id' => $cid, 'seller_id' => $this->sellerId, 'website_id' => $this->siteId,'lang' => $this->lang],['module.moduleField'])['data']->toArray(); - Cache::set($cateCacheKey,$category); - }catch (ModelEmptyException $me){ - $category = $Category->getCategory(['id' => $cid, 'seller_id' => $this->sellerId, 'website_id' => $this->realSiteId,'lang' => $this->lang],['module.moduleField'])['data']->toArray(); - Cache::set($cateCacheKey,$category); + $category = $Category->getCategory(['id' => $cid, 'seller_id' => $this->sellerId, 'website_id' => $this->siteId, 'lang' => $this->lang], ['module.moduleField'])['data']->toArray(); + Cache::set($cateCacheKey, $category); + } catch (ModelEmptyException $me) { + $category = $Category->getCategory(['id' => $cid, 'seller_id' => $this->sellerId, 'website_id' => $this->realSiteId, 'lang' => $this->lang], ['module.moduleField'])['data']->toArray(); + Cache::set($cateCacheKey, $category); } } if (!empty($category['content'])) { @@ -75,9 +76,9 @@ class DetailController extends BaseController $category['seo_description'] .= ",$huocmsPowerby"; } - $this->assign('hc_content',$content->toArray()); - $this->assign('current_cate',$category); - $this->assign('root_domain',$this->rootDomain); + $this->assign('hc_content', $content->toArray()); + $this->assign('current_cate', $category); + $this->assign('root_domain', $this->rootDomain); $template = !empty($content['detail_tpl']) ? $content['detail_tpl'] : $category['detail_tpl']; return $this->fetch($template); } @@ -89,12 +90,12 @@ class DetailController extends BaseController */ public function preview() { - $param = $this->request->only(['id','cid','lang'=>$this->lang,'website_id'=>$this->realSiteId]); + $param = $this->request->only(['id', 'cid', 'lang' => $this->lang, 'website_id' => $this->realSiteId]); $Category = new Category(); - $category = $Category->getCustomArrayData(['id' => $param['cid'], 'website_id' => $param['website_id'],'lang' => $param['lang']],['module.moduleField'])['data']; - if(empty($category)){ + $category = $Category->getCustomArrayData(['id' => $param['cid'], 'website_id' => $param['website_id'], 'lang' => $param['lang']], ['module.moduleField'])['data']; + if (empty($category)) { Log::error("栏目不存在"); - throw new HttpException(404,'资源不存在'); + throw new HttpException(404, '资源不存在'); } $param['cate'] = $category; $param['seller_id'] = $this->sellerId; @@ -105,23 +106,23 @@ class DetailController extends BaseController } $contentService = new ContentService(); $content = $contentService->getPreviewContent($param); - if(empty($content)){ + if (empty($content)) { Log::error("内容不存在"); - throw new HttpException(404,'资源不存在'); + throw new HttpException(404, '资源不存在'); } if (!empty($content['content'])) { $content['content'] = htmlspecialchars_decode($content['content']); } - if($category['id'] == 41 && empty($content['content'])){ - if(empty($content['main_content']['file']['url'])){ + if ($category['id'] == 41 && empty($content['content'])) { + if (empty($content['main_content']['file']['url'])) { return redirect('/404.html'); - }else{ + } else { $url = $content['main_content']['file']['url']; return redirect($url); } } - View::assign('hc_content',$content->toArray()); - View::assign('current_cate',$category); + View::assign('hc_content', $content->toArray()); + View::assign('current_cate', $category); $template = !empty($content['detail_tpl']) ? $content['detail_tpl'] : $category['detail_tpl']; return $this->fetch($template); } diff --git a/HuoCMS_close_source/public/themes/website/1/zh/deshi.neicela.com/about.html b/HuoCMS_close_source/public/themes/website/1/zh/deshi.neicela.com/about.html index 9ad1124..0a300b4 100644 --- a/HuoCMS_close_source/public/themes/website/1/zh/deshi.neicela.com/about.html +++ b/HuoCMS_close_source/public/themes/website/1/zh/deshi.neicela.com/about.html @@ -1,539 +1,381 @@ - - - - - + + + + DESHI-关于我们 - - - - - - - + + + + + + + - -