fix
This commit is contained in:
@@ -66,7 +66,7 @@ module.exports.changeStatus = [
|
||||
status: 1
|
||||
},
|
||||
{ new: true })
|
||||
const userPreData = await User.findById(data.userId)
|
||||
const userPreData = await User.findById(data.userId).select('walletBalance dollarBalance score')
|
||||
const userData = await User.findByIdAndUpdate(
|
||||
data.userId,
|
||||
{
|
||||
@@ -74,7 +74,9 @@ module.exports.changeStatus = [
|
||||
shopNumber: data.shopNumber,
|
||||
shopAddress: data.shopAddress,
|
||||
birthDate: data.birthDate,
|
||||
walletBalance:userPreData?.walletBalance | 0
|
||||
walletBalance: userPreData?.walletBalance | 0,
|
||||
dollarBalance: userPreData?.dollarBalance | 0,
|
||||
score: userPreData?.score | 0
|
||||
},
|
||||
{ new: true }
|
||||
)
|
||||
|
||||
@@ -68,6 +68,16 @@ const UserSchema = mongoose.Schema({
|
||||
min:0,
|
||||
default:0
|
||||
},
|
||||
dollarBalance:{
|
||||
type:Number,
|
||||
min:0,
|
||||
default:0
|
||||
},
|
||||
score:{
|
||||
type:Number,
|
||||
min:0,
|
||||
default:0
|
||||
},
|
||||
cardBank:[BankSchema],
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user