From dc230a42d55baa46f4d8e8002bb76b6971800c7b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 21 Dec 2024 13:10:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_login.go | 10 ++++------ app/hdl/hdl_user.go | 2 +- go.mod | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 6356b11..45e0137 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -429,17 +429,15 @@ func commReq(c *gin.Context, req md.RegisterReq) { // Todo::拥有上下级关系 parentUser, err = userDb.GetUserByInviteCode(req.InviteCode) if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err) + e.OutErr(c, e.ERR_SUP_NOTFOUND, "邀请码失效,请联系上级重新获取分享!") return } - if parentUser.Id == 0 { + if parentUser == nil { parentUser, err = userDb.GetUserByCustomInviteCode(req.InviteCode) - if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err) + if err != nil || parentUser == nil { + e.OutErr(c, e.ERR_SUP_NOTFOUND, "邀请码失效,请联系上级重新获取分享!") return } - e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") - return } } var parentUid = func() int64 { diff --git a/app/hdl/hdl_user.go b/app/hdl/hdl_user.go index f3c16ab..0bfb9bc 100644 --- a/app/hdl/hdl_user.go +++ b/app/hdl/hdl_user.go @@ -99,7 +99,7 @@ func InviteCodeUserInfo(c *gin.Context) { "value": req.InviteCode, }) if user == nil { - e.OutErr(c, 400, e.NewErr(400, "用户不存在")) + e.OutErr(c, 400, e.NewErr(400, "邀请码失效,请联系上级重新获取分享")) return } } diff --git a/go.mod b/go.mod index 1aab430..bad0009 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241219070554-7d4bf7b5cbb2 + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241221050305-1f1fb9ecdbaa code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241220073933-42987f91e880 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 From d757634be31155246da5532dfab296f54198416b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 21 Dec 2024 13:49:18 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/svc/svc_user_invitecode.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/svc/svc_user_invitecode.go b/app/svc/svc_user_invitecode.go index bd0b12e..8767980 100644 --- a/app/svc/svc_user_invitecode.go +++ b/app/svc/svc_user_invitecode.go @@ -2,6 +2,7 @@ package svc import ( "applet/app/db" + "applet/app/utils" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "math/rand" "unicode" @@ -28,7 +29,11 @@ func ReturnCode(l, types, num int) string { customTmp, _ := userDb.UserFindByCustomInviteCodes(codes...) //循环生成的邀请码 判断tmp里有没有这个邀请码 如果邀请码没有就赋值 再判断是否存在 存在就清空 + repeat := []string{"46ZQP3", "YJ61CV", "FBBD6P", "K2ZK47", "S46ZQP", "8QZEN6", "X1K9JI", "RY2HUG", "FQJOF6", "3HFFVH", "ALRC49", "1I6DBA", "RT537I", "R8Z95Z", "ADT33R", "9Z5N3C", "AMLIB0", "4FJ2HM", "1P1186", "373V3E", "IGCL3W", "RY4N0T", "12B5VA", "G7BKRS", "NBQWY3", "5C9RGD", "0SQSS7", "OARC7F", "O9RQKR", "LV6SMZ", "RY929H", "2CGLA5", "6WG3W7", "2OCXXJ", "Z74D5E", "MZT1BE", "5KU4Z9", "JMY2OA", "TVO9LM", "MX4ORM", "AFQ60J", "B2LLUQ", "S66KH5", "CMO6XX", "9JNH3G", "I5KSZL", "V3QMWG", "NYOS6I", "SCCX47", "IE250I", "95LT56", "OSJ7VD", "UWW8JU", "GPQUP3", "9YJ0CI", "2JA8YT", "Z5MOM4", "B41PBO", "7QUTOH", "FN3N4F", "639NNI", "9GDNEZ", "6BLIIS", "MHKK2I", "W05VR0", "QNI24A", "6Z13ER", "SU8VQL", "H0JKDS", "P6X6XI", "EXQ8P1", "1NZJBI", "HJI1GT", "M6OLIZ", "66WS8X", "XXS04V", "VNR363", "FD9CRH", "40TCCD", "QNWZR1", "6EAD47", "1HK0KF", "AR3IY5", "F1B3GM", "Q479YA", "F7D198", "VD7FXV", "8I7WF4", "SUO254", "VTH32H", "SLHLA5", "7TFEFZ", "73L091", "3CEYZ2", "20ZIY5", "4Q6JIK", "P4K0NX", "M04OUK", "3KUZSH", "YZG4HN", "A5LE91", "CDJQO4", "5XTSKP", "3KOR4B", "S69MBU", "881EYC", "KDZB13", "K22C83", "M08M6A", "31OY42", "8FHO8O", "P7AE2M", "W6ADG4", "DMAGW9", "AV653E", "9NEFFX", "P8E8LX", "1PINC4", "1Y2A0B", "HD1BPN", "S3W9WB", "Q9I0XO", "75K0KL", "Y72G14", "KL8HAX", "JS41K1", "G4L34B", "RV8KBP", "VG2S5B", "V6ZP51", "S5DWD8", "J24KTU", "N7IFG8", "4Z94WX", "4TOK2G", "8COMEX", "OO2M08", "IQDA9G", "V1Y8HC", "UBE4KZ", "C6JVML", "89DHLX", "PIW413", "UAJ4KB", "SPEQB9", "7CJDW8", "E2Q8MW", "M1PDC3", "1C7QIR", "O122E4", "F735IK", "4GGZU3", "4CW5N8", "ISCC02", "7WB4ET", "7PQQK4", "FSKO12", "6VREUP", "Q21NUE", "KOK7GQ", "J2U1U9", "TJ3O19", "99SWY1", "46SO3B", "NO5HE5", "J2N5GU", "2ADNIW", "K014LU", "UDC2RY", "DSGQ3O", "579A6Z", "MG3H08", "WXZL8M", "MG8PG7", "1JKUF8", "ITP4WQ", "6FAOU3", "00GTZQ", "XYUYO4", "GS9YJ6", "KQ7UWT", "7981LY", "J7BGGU", "XMJEB9", "E58TS4", "IL82FA", "P3RR5Z", "5RYDW0", "GCU8OJ", "12YH73", "K8LF5L", "Z79K5R", "KHX1BY", "7K3YSL", "WM9OH5", "0DL3OH", "KKLQJ1", "XPROG1", "OB66GR", "7ZYCNE", "L6010Q", "9KNBJC", "H0A6Z2", "VC5X88", "MAZKT8", "FZTL3Q", "T58EF4", "G7A2PB", "K19Y5W", "39842R", "UIIX8U", "GY5D0Y", "3723U5", "5UZPDO", "74RTB0", "5J9ZQ3", "24S3YM", "UZ7CF8", "J8FYO6", "MF7AKW", "OMY3T6", "X0F7YO", "NCGTM2", "MZNPO3", "ROBSR6", "67CHNX", "Y1KTV2", "PKZ925", "429OSC", "WB8TRY", "7ZWUQ4", "F8HQGC", "5NG2HI", "RTRQ9W", "4EH1GI", "VSQB15", "34ZRJS", "ENO4TN", "MW0P2T", "IR298E", "3ZEH1K", "NRHKD4", "EVL5DO", "A17WRT", "1SGNB7", "28YJXV", "DQEQ8G", "X4ZI02", "E4VXT8", "J7AV62", "N3BNH8", "IVUX2P", "Y5KOXS", "SRT4X1", "FBY12A", "5HMYIR", "ONCKZ7", "0D84XJ", "BX9YZ2", "SIS6RC", "ZT7TFB", "TRPBB9", "V7QMAH"} for _, v := range codes { + if utils.InArr(v, repeat) { //出问题的不给用了 + continue + } if code != "" { //如果存在并且数据库没有就跳过 continue } From 902ce861f5e9fce711acdc54d969d13e7087bf12 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Sat, 21 Dec 2024 19:50:06 +0800 Subject: [PATCH 3/8] update --- app/hdl/hdl_add_friend.go | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index 9a8f445..fef2f3b 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -565,21 +565,35 @@ func MyFans(c *gin.Context) { nativeString1, _ := db.QueryNativeString(db.Db, sql) hasUserCount := utils.StrToInt64(nativeString1[0]["total"]) - session := db.Db.NewSession() - defer session.Close() - now := time.Now() - assistanceDb := implement.NewEggEnergyTeamAssistanceDb(db.Db) - assistance, err := assistanceDb.EggEnergyTeamAssistanceGetOneBySession(session, user.Id, now.Format("2006-01-02")) + nowStr := time.Now().Format("2006-01-02 15:04:05") + signInDb := implement.NewEggSignInDb(db.Db) + has, signIn, err := signInDb.EggSignINGetOneByTimeAndUid("", nowStr, user.Id, 0) if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err) + e.OutErr(c, e.ERR_DB_ORM, err.Error()) return } var nowTeamAssistanceNum int var nowTeamAssistanceReward string - if assistance != nil { - nowTeamAssistanceNum = assistance.AssistedNum - nowTeamAssistanceReward = assistance.RewardScore + if !has { + nowTeamAssistanceNum = 0 + nowTeamAssistanceReward = "0" + } else { + session := db.Db.Where("") + assistanceDb := implement.NewEggEnergyTeamAssistanceDb(db.Db) + assistance, err := assistanceDb.EggEnergyTeamAssistanceGetOneByParamsBySession(session, map[string]interface{}{ + "key": "sign_id", + "value": signIn.Id, + }) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err) + return + } + if assistance != nil { + nowTeamAssistanceNum = assistance.AssistedNum + nowTeamAssistanceReward = assistance.RewardScore + } } + resp := md.MyFansResp{ NowTeamUser: hasUserCount, NowTeamAssistanceNum: nowTeamAssistanceNum, From 7c4e9000e3a269dae3c9cb2de17c07258cdce81c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 22 Dec 2024 00:45:45 +0800 Subject: [PATCH 4/8] test --- app/hdl/hdl_add_friend.go | 3 +-- go.mod | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index fef2f3b..c2d416c 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -578,9 +578,8 @@ func MyFans(c *gin.Context) { nowTeamAssistanceNum = 0 nowTeamAssistanceReward = "0" } else { - session := db.Db.Where("") assistanceDb := implement.NewEggEnergyTeamAssistanceDb(db.Db) - assistance, err := assistanceDb.EggEnergyTeamAssistanceGetOneByParamsBySession(session, map[string]interface{}{ + assistance, err := assistanceDb.EggEnergyTeamAssistanceGetOneByParams(map[string]interface{}{ "key": "sign_id", "value": signIn.Id, }) diff --git a/go.mod b/go.mod index bad0009..2342d70 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241221050305-1f1fb9ecdbaa + 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/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 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 5/8] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E6=89=A3=E4=BD=99?= =?UTF-8?q?=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 From b9cd24342ac8fcc233397be19239efdfa6a7f62c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 22 Dec 2024 13:21:26 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E6=89=A3=E4=BD=99?= =?UTF-8?q?=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 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/svc/svc_user_real_name.go b/app/svc/svc_user_real_name.go index be8ea4e..60252db 100644 --- a/app/svc/svc_user_real_name.go +++ b/app/svc/svc_user_real_name.go @@ -22,7 +22,7 @@ func GetRealNameAuthBase(c *gin.Context) { var res = &md.RealNameAuthBasicData{ AuthState: "0", IsNeedGetEnergy: "1", - TipStr: "请前往蛋蛋乐园获取能量", + TipStr: "请先前往积分中心使用部分能量值兑换余额", } res.AuthState = "0" @@ -31,8 +31,9 @@ func GetRealNameAuthBase(c *gin.Context) { user := GetUser(c) egg_system_rules.Init(cfg.RedisAddr) amount := GetSysCfgStr("user_real_name_money") - _, can := egg_energy.CheckActivityCoinToAlipayRealName(db.Db, user.Id, amount) - if can { + NewUserWalletDb := implement.NewUserWalletDb(db.Db) + wallet, _ := NewUserWalletDb.GetUserVirtualWallet(user.Id) + if wallet != nil && utils.StrToFloat64(wallet.Amount) >= utils.StrToFloat64(amount) { res.IsNeedGetEnergy = "0" } NewUserRealNameAuthDb := implement.NewUserRealNameAuthDb(eg) @@ -70,7 +71,7 @@ func GetRealNameAuthState(c *gin.Context) { var res = &md.RealNameAuthBasicData{ AuthState: "0", IsNeedGetEnergy: "1", - TipStr: "请前往蛋蛋乐园获取能量", + TipStr: "请先前往积分中心使用部分能量值兑换余额", } res.AuthState = "0" //判断审核状态 @@ -78,8 +79,9 @@ func GetRealNameAuthState(c *gin.Context) { user := GetUser(c) egg_system_rules.Init(cfg.RedisAddr) amount := GetSysCfgStr("user_real_name_money") - _, can := egg_energy.CheckActivityCoinToAlipayRealName(db.Db, user.Id, amount) - if can { + NewUserWalletDb := implement.NewUserWalletDb(db.Db) + wallet, _ := NewUserWalletDb.GetUserVirtualWallet(user.Id) + if wallet != nil && utils.StrToFloat64(wallet.Amount) >= utils.StrToFloat64(amount) { res.IsNeedGetEnergy = "0" } NewUserRealNameAuthDb := implement.NewUserRealNameAuthDb(eg) From 55e1386cb7cdeef10fa4c4fd05fdbd8fda5a9ff2 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 22 Dec 2024 13:24:25 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E6=89=A3=E4=BD=99?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/svc/svc_withdraw_apply.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/svc/svc_withdraw_apply.go b/app/svc/svc_withdraw_apply.go index 1e292c9..755be75 100644 --- a/app/svc/svc_withdraw_apply.go +++ b/app/svc/svc_withdraw_apply.go @@ -304,6 +304,10 @@ func GetWithdrawCondition(user *model.User, setting *model.FinWithdrawSetting, i return false }(firstWithdrawSet.IsNeedRealName) resp.FirstWithdrawAmountLimit = firstWithdrawSet.FirstWithdrawAmountLimit + if resp.FirstNeedRealName == false { //第一次不用实名,就不判断这个了 + resp.IsCanWithdraw = true + resp.NotWithdrawReason = "" + } } return resp From 351b2101e2dacfa5f7eafe9df1a9d89f3c8d801c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 22 Dec 2024 13:29:41 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E6=89=A3=E4=BD=99?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/svc/svc_withdraw_apply.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/svc/svc_withdraw_apply.go b/app/svc/svc_withdraw_apply.go index 755be75..1e292c9 100644 --- a/app/svc/svc_withdraw_apply.go +++ b/app/svc/svc_withdraw_apply.go @@ -304,10 +304,6 @@ func GetWithdrawCondition(user *model.User, setting *model.FinWithdrawSetting, i return false }(firstWithdrawSet.IsNeedRealName) resp.FirstWithdrawAmountLimit = firstWithdrawSet.FirstWithdrawAmountLimit - if resp.FirstNeedRealName == false { //第一次不用实名,就不判断这个了 - resp.IsCanWithdraw = true - resp.NotWithdrawReason = "" - } } return resp