Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
wenbo.dong 2017-07-20 11:32:24 +08:00
commit 23f1c6f9f7
4 changed files with 10 additions and 6 deletions

View File

@ -227,7 +227,7 @@ class projectController extends baseController {
try{
let result = await this.Model.listWithPaging(group_id, page, limit);
let count = await this.Model.listCount();
let count = await this.Model.listCount(group_id);
ctx.body = yapi.commons.resReturn({
total: Math.ceil(count / limit),
list: result

View File

@ -74,8 +74,10 @@ class projectModel extends baseModel{
}).skip((page - 1) * limit).limit(limit).exec();
}
listCount() {
return this.model.count();
listCount(group_id) {
return this.model.count({
group_id: group_id
});
}
countByGroupId(group_id){

View File

@ -602,7 +602,7 @@ var projectController = function (_baseController) {
case 6:
result = _context6.sent;
_context6.next = 9;
return this.Model.listCount();
return this.Model.listCount(group_id);
case 9:
count = _context6.sent;

View File

@ -117,8 +117,10 @@ var projectModel = function (_baseModel) {
}
}, {
key: 'listCount',
value: function listCount() {
return this.model.count();
value: function listCount(group_id) {
return this.model.count({
group_id: group_id
});
}
}, {
key: 'countByGroupId',