浏览代码

家族列表调整

zhangxiaobin 1 年之前
父节点
当前提交
f6dc4e5b51
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      application/api/controller/Guild.php

+ 4 - 0
application/api/controller/Guild.php

@@ -169,6 +169,9 @@ class Guild extends Api
      */
     public function getGuildList() {
         $search = $this->request->request("search","","string"); //搜索的字段 公会名称/公会ID
+        $page = $this->request->request("page",1);
+        $pageNum = $this->request->request("pageNum",10);
+        $offset = ($page-1) * $pageNum;
         //if(!$search) $this->error("请输入要搜索的公会名称或公会ID");
         global $whereOr;
         $where = [];$whereOr = [];
@@ -183,6 +186,7 @@ class Guild extends Api
                 global $whereOr;
                 $query->whereOr($whereOr);
             })
+            ->limit($offset,$pageNum)
             ->select();
         $this->success("获取成功!",$res);
     }