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