refact production list
This commit is contained in:
parent
10c52a75b9
commit
d2491bfbf4
|
@ -2,9 +2,6 @@ module.exports = function(Self) {
|
||||||
Self.defineScope();
|
Self.defineScope();
|
||||||
|
|
||||||
Self.list = function(ctx, filter, callback) {
|
Self.list = function(ctx, filter, callback) {
|
||||||
var page = filter.page - 1;
|
|
||||||
var limit = filter.limit * page;
|
|
||||||
var offset = (page + 1) * filter.limit;
|
|
||||||
let daysTickets = 0;
|
let daysTickets = 0;
|
||||||
let warehouseFk = filter.where.warehouseFk;
|
let warehouseFk = filter.where.warehouseFk;
|
||||||
delete filter.limit;
|
delete filter.limit;
|
||||||
|
@ -80,7 +77,7 @@ module.exports = function(Self) {
|
||||||
}, this);
|
}, this);
|
||||||
obj.m3 = obj.m3.toFixed(2);
|
obj.m3 = obj.m3.toFixed(2);
|
||||||
obj.total = tickets.length;
|
obj.total = tickets.length;
|
||||||
obj.tickets = tickets.slice(limit, offset);
|
obj.tickets = tickets;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue