zhanglinxin il y a 1 an
Parent
commit
2cfe965f61
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      application/api/controller/Base.php

+ 2 - 4
application/api/controller/Base.php

@@ -52,10 +52,8 @@ class Base extends Controller
         $actionname = strtolower($this->request->action());
         $this->checking($modulename, $controllername, $actionname);
 
-        $page = input('page');
-        $page_num = input('page_num');
-        $this->page = $page ? $page : 1;
-        $this->page_num = $page_num ? $page_num : 20;
+        $this->page = input('page') ?: 1;
+        $this->page_num = input('page_num') ?: 20;
         $this->off_set = ($this->page * $this->page_num) - $this->page_num;
         $path = explode('/', $this->request->path());
         if (!empty($this->need_login) && in_array(end($path), $this->need_login)) {