bug fixed list producction
This commit is contained in:
parent
2bb87dc195
commit
d19ebe0c8c
|
@ -68,7 +68,8 @@ module.exports = function(Self) {
|
|||
}
|
||||
|
||||
function sum(tickets) {
|
||||
var obj = {lines: 0, m3: 0};
|
||||
let obj = {lines: 0, m3: 0};
|
||||
if (tickets && tickets.length)
|
||||
tickets.forEach(function(t, i) {
|
||||
obj.lines += t.lines;
|
||||
obj.m3 += t.m3;
|
||||
|
@ -76,8 +77,8 @@ module.exports = function(Self) {
|
|||
tickets[i].problem = tickets[i].problem.trim();
|
||||
}, this);
|
||||
obj.m3 = obj.m3.toFixed(2);
|
||||
obj.total = tickets.length;
|
||||
obj.tickets = tickets;
|
||||
obj.total = tickets ? tickets.length : 0;
|
||||
obj.tickets = tickets || [];
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue