Ver código fonte

实名扣余额

master
huangjiajun 14 horas atrás
pai
commit
02eaf43273
2 arquivos alterados com 14 adições e 5 exclusões
  1. +13
    -4
      app/svc/svc_user_real_name.go
  2. +1
    -1
      go.mod

+ 13
- 4
app/svc/svc_user_real_name.go Ver arquivo

@@ -162,9 +162,14 @@ func RealNameSave(c *gin.Context) {
list, _ := NewUserRealNameAuthDb.GetRealNameAuthByUid(utils.Int64ToStr(user.Id))
amount := GetSysCfgStr("user_real_name_money")
if list != nil && list.IsPay != 1 || list == nil {
_, can := egg_energy.CheckActivityCoinToAlipayRealName(db.Db, user.Id, amount)
if can == false {
e.OutErr(c, 400, e.NewErr(400, "请先前往蛋蛋乐园获取能量值"))
NewUserWalletDb := implement.NewUserWalletDb(db.Db)
wallet, _ := NewUserWalletDb.GetUserVirtualWallet(user.Id)
if wallet == nil {
e.OutErr(c, 400, e.NewErr(400, "请先前往积分中心使用部分能量值兑换余额"))
return
}
if utils.StrToFloat64(wallet.Amount) < utils.StrToFloat64(amount) {
e.OutErr(c, 400, e.NewErr(400, "请先前往积分中心使用部分能量值兑换余额"))
return
}
}
@@ -206,7 +211,11 @@ func RealNameSave(c *gin.Context) {
if isNeedPay == "1" {
err = egg_energy.ActivityCoinToAlipayRealName(db.Db, user.Id, amount)
if err != nil {
e.OutErr(c, 400, err)
if err.Error() == "用户钱包余额不足" {
e.OutErr(c, 400, e.NewErr(400, "请先前往积分中心使用部分能量值兑换余额"))
return
}
e.OutErr(c, 400, err.Error())
return
}
list.IsPay = 1


+ 1
- 1
go.mod Ver arquivo

@@ -34,7 +34,7 @@ require (

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241221164231-20952e894d1d
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241220073933-42987f91e880
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241222045429-f4c462be9b42
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible


Carregando…
Cancelar
Salvar