fix(topup): guard wallet quota during recharge
This commit is contained in:
@@ -123,11 +123,11 @@ func RequestWaffoAmount(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": fmt.Sprintf("充值数量不能小于 %d", waffoMinTopup)})
|
||||
return
|
||||
}
|
||||
if rejectInvalidTopUpQuota(c, req.Amount) {
|
||||
id := c.GetInt("id")
|
||||
if rejectInvalidTopUpQuota(c, id, req.Amount) {
|
||||
return
|
||||
}
|
||||
|
||||
id := c.GetInt("id")
|
||||
group, err := model.GetUserGroup(id, true)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": "获取用户分组失败"})
|
||||
@@ -160,11 +160,11 @@ func RequestWaffoPay(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": fmt.Sprintf("充值数量不能小于 %d", waffoMinTopup)})
|
||||
return
|
||||
}
|
||||
if rejectInvalidTopUpQuota(c, req.Amount) {
|
||||
id := c.GetInt("id")
|
||||
if rejectInvalidTopUpQuota(c, id, req.Amount) {
|
||||
return
|
||||
}
|
||||
|
||||
id := c.GetInt("id")
|
||||
user, err := model.GetUserById(id, false)
|
||||
if err != nil || user == nil {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": "用户不存在"})
|
||||
|
||||
Reference in New Issue
Block a user