ZxcZxc123 2 anni fa
parent
commit
a204c74f49

+ 7 - 2
app/api/controller/Education.php

@@ -28,9 +28,14 @@ class Education
             $where["type1"] = 1;
         }
 
-        $grlist = $EducationModel->getEducationGrList($where, 20, "od asc,recommend desc,gr_id desc");
+        $page = input('page/d', 1);
+        $pageSize = input('pageSize/d', 20);
 
-        $result = ['grlist' => $grlist,];
+        $grlist = $EducationModel->where($where)
+            ->order("od asc,recommend desc,gr_id desc")
+            ->paginate($pageSize, false, ['page' => $page]);
+
+        $result = ['grlist' => $grlist->items(), 'total' => $grlist->total()];
 
         return app('json')->success($result);
     }

+ 2 - 2
app/system/controller/GroupController.php

@@ -19,7 +19,7 @@ class GroupController extends BaseController
     {
         $title = Request::param('title');
         $page = Request::param('page', 1, 'intval');
-        $pagesize = Request::param('pagesize', 10, 'intval');
+        $pageSize = Request::param('pageSize', 10, 'intval');
 
         $groupModel = new GroupModel();
         $query = $groupModel->order('gr_id ASC');
@@ -30,7 +30,7 @@ class GroupController extends BaseController
 
         $list = $query->paginate([
             'page' => $page,
-            'list_rows' => $pagesize,
+            'list_rows' => $pageSize,
         ]);
 
         $data = [