fix: 改手机号后换邀请码

This commit is contained in:
chaosBreaking
2019-09-08 01:17:32 +08:00
parent 58a58ad675
commit 8ecb5e586a
2 changed files with 4 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ const FundSchema = new mongoose.Schema({
'usdtTRX': '' 'usdtTRX': ''
} }
}, },
// fund 为充值的矿晶的一系列数值,用于计算收益 // fundList 为充值的矿晶的一系列数值,用于计算收益
// fund = 矿晶单位KG // fund = 矿晶单位KG
fundList: [{}], fundList: [{}],
// fundSum, 用户充值的总usdt数 // fundSum, 用户充值的总usdt数

View File

@@ -33,8 +33,10 @@ module.exports = {
code: 2, code: 2,
error: 'Incorrect Code' error: 'Incorrect Code'
}); });
const newInviteCode = parseInt(phone.split('-')[1]).toString(36);
return User.findByIdAndUpdate(userId, { return User.findByIdAndUpdate(userId, {
phone phone,
inviteCode: newInviteCode
}).then(data => { }).then(data => {
res.json({ res.json({
code: 0, code: 0,