mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-24 13:14:16 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
23f1c6f9f7
@ -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
|
||||
|
@ -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){
|
||||
|
@ -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;
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user