fix: 改手机号后换邀请码
This commit is contained in:
@@ -17,7 +17,7 @@ const FundSchema = new mongoose.Schema({
|
|||||||
'usdtTRX': ''
|
'usdtTRX': ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// fund 为充值的矿晶的一系列数值,用于计算收益
|
// fundList 为充值的矿晶的一系列数值,用于计算收益
|
||||||
// fund = 矿晶,单位KG
|
// fund = 矿晶,单位KG
|
||||||
fundList: [{}],
|
fundList: [{}],
|
||||||
// fundSum, 用户充值的总usdt数
|
// fundSum, 用户充值的总usdt数
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user