fix: group计算初始值

This commit is contained in:
chaosBreaking
2019-09-08 11:15:21 +08:00
parent 84d832d859
commit 8edcc85903

View File

@@ -125,7 +125,7 @@ module.exports = {
const list = await User.find({ inviter: userId }).exec();
const sum = list.reduce((acc, u) => {
return acc += u.group && u.group.length || 0;
}, 0);
}, list.length); // 累加器初始值是列表的长度
return res.json({
code: 0,
data: {