dever %!s(int64=6) %!d(string=hai) anos
pai
achega
60b2387fae
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      main/src/View.php

+ 6 - 2
main/src/View.php

@@ -7,6 +7,7 @@ use Main\Lib\Core;
 
 class View extends Core
 {
+    private $addView = true;
     # 获取评论列表
     public function comment()
     {
@@ -111,8 +112,10 @@ class View extends Core
         }
         
 
-        # 浏览量+1
-        Dever::load($method)->addView($id);
+        if ($this->addView) {
+            # 浏览量+1
+            Dever::load($method)->addView($id);
+        }
 
         return $this->data;
     }
@@ -168,6 +171,7 @@ class View extends Core
     # 根据类型,获取详情的html页面
     public function getHtml()
     {
+        $this->addView = false;
         $type = Dever::input('type');
         $id = Dever::input('id');
         $signature = Dever::input('signature');