wesmiler 5 лет назад
Родитель
Сommit
2a0a184b70

+ 3 - 3
app/index/controller/JiamengController.php

@@ -50,7 +50,7 @@ class JiamengController extends HomeBaseController
     public function lists()
     {
         $param = $this->request->param();
-        $cacheKey = 'cache:jiameng_pages:list:' . md5(json_encode($param));
+        $cacheKey = 'cache:jiameng_pages:list:' . md5(json_encode($param)).'_'.intval(cmf_is_mobile());
         $pageHtml = RedisService::get($cacheKey);
         if ($pageHtml) {
             return $pageHtml;
@@ -166,7 +166,7 @@ class JiamengController extends HomeBaseController
     public function search()
     {
         $param = $this->request->param();
-        $cacheKey = 'cache:jiameng_pages:search:' . md5(json_encode($param));
+        $cacheKey = 'cache:jiameng_pages:search:' . md5(json_encode($param)).'_'.intval(cmf_is_mobile());
         $pageHtml = RedisService::get($cacheKey);
         if ($pageHtml) {
             return $pageHtml;
@@ -272,7 +272,7 @@ class JiamengController extends HomeBaseController
     {
         $param = $this->request->param();
         isset($param['id']) or $this->error('需要id');
-        $cacheKey = 'cache:jiameng_pages:show_' . $param['id'];
+        $cacheKey = 'cache:jiameng_pages:show_' . $param['id'].'_'.intval(cmf_is_mobile());
         $pageHtml = RedisService::get($cacheKey);
         //更新点击次数
         Db::name('jiameng')->where('id', $param['id'])->setInc('hits', 1);

+ 2 - 2
app/index/controller/NewsController.php

@@ -55,7 +55,7 @@ class NewsController extends HomeBaseController
     public function show(){
         $param = $this->request->param();
         isset($param['id']) or $this->error('非法访问');
-        $cacheKey = 'cache:news_pages:show_' . $param['id'];
+        $cacheKey = 'cache:news_pages:show_' . $param['id'].'_'.intval(cmf_is_mobile());
         $pageHtml = RedisService::get($cacheKey);
         //更新点击次数
         Db::name('jiameng')->where('id', $param['id'])->setInc('hits', 1);
@@ -152,7 +152,7 @@ class NewsController extends HomeBaseController
         $catinfo = [];
         $param = $this->request->param();
 
-        $cacheKey = 'cache:news_pages:list:' . md5(json_encode($param));
+        $cacheKey = 'cache:news_pages:list:' . md5(json_encode($param)).'_'.intval(cmf_is_mobile());
         $pageHtml = RedisService::get($cacheKey);
         if ($pageHtml) {
             return $pageHtml;