From 02eaf43273d4a2e22e5217d65948e547dc648460 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 22 Dec 2024 13:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E6=89=A3=E4=BD=99=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/svc/svc_user_real_name.go | 17 +++++++++++++---- go.mod | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/svc/svc_user_real_name.go b/app/svc/svc_user_real_name.go index ea65eb2..be8ea4e 100644 --- a/app/svc/svc_user_real_name.go +++ b/app/svc/svc_user_real_name.go @@ -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 diff --git a/go.mod b/go.mod index 2342d70..36fa873 100644 --- a/go.mod +++ b/go.mod @@ -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