fix: group计算初始值
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user