From bd82ac5c2565b94ee2f1f184169f55d681a0c25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=94=BE?= Date: Wed, 19 Jul 2017 19:55:25 +0800 Subject: [PATCH] =?UTF-8?q?opti:=20=E4=BC=98=E5=8C=96list=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9Etotal=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/controllers/project.js | 2 +- server/controllers/user.js | 2 +- server_dist/controllers/project.js | 2 +- server_dist/controllers/user.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/controllers/project.js b/server/controllers/project.js index e2c62288..69ee27c4 100644 --- a/server/controllers/project.js +++ b/server/controllers/project.js @@ -229,7 +229,7 @@ class projectController extends baseController { let result = await this.Model.listWithPaging(group_id, page, limit); let count = await this.Model.listCount(); ctx.body = yapi.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: result }) }catch(err){ diff --git a/server/controllers/user.js b/server/controllers/user.js index a98fe230..cbe0fd54 100644 --- a/server/controllers/user.js +++ b/server/controllers/user.js @@ -305,7 +305,7 @@ class userController extends baseController { let user = await userInst.listWithPaging(page, limit); let count = await userInst.listCount(); return ctx.body = yapi.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: user }); } catch(e) { diff --git a/server_dist/controllers/project.js b/server_dist/controllers/project.js index 824b8f84..3b9b1414 100644 --- a/server_dist/controllers/project.js +++ b/server_dist/controllers/project.js @@ -608,7 +608,7 @@ var projectController = function (_baseController) { count = _context6.sent; ctx.body = _yapi2.default.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: result }); _context6.next = 16; diff --git a/server_dist/controllers/user.js b/server_dist/controllers/user.js index ecab6179..480a26f6 100644 --- a/server_dist/controllers/user.js +++ b/server_dist/controllers/user.js @@ -666,7 +666,7 @@ var userController = function (_baseController) { case 8: count = _context9.sent; return _context9.abrupt('return', ctx.body = _yapi2.default.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: user }));