From de53ac55419e79841eed4ddeb1537c826dae55cb Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 15:49:23 +0800 Subject: [PATCH 1/9] update --- app/hdl/hdl_points_center.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/hdl/hdl_points_center.go b/app/hdl/hdl_points_center.go index d59a56f..acb67cc 100644 --- a/app/hdl/hdl_points_center.go +++ b/app/hdl/hdl_points_center.go @@ -581,7 +581,12 @@ func GetContributionValue(c *gin.Context) { } var contributionValue string if virtualAmount != nil { - contributionValue = virtualAmount.Amount + contributionValueDecimal, err := decimal.NewFromString(virtualAmount.Amount) + if err != nil { + e.OutErr(c, e.ERR_UNMARSHAL, err.Error()) + return + } + contributionValue = contributionValueDecimal.StringFixed(0) } coinDb := implement.NewVirtualCoinDb(db.Db) @@ -650,7 +655,12 @@ func GetContributionValueFlow(c *gin.Context) { list := make([]md.ContributionValueFlowNode, len(flows)) for i, flow := range flows { list[i].Title = flow.Title - list[i].Amount = flow.Amount + amountDecimal, err1 := decimal.NewFromString(flow.Amount) + if err1 != nil { + e.OutErr(c, e.ERR_UNMARSHAL, err1.Error()) + return + } + list[i].Amount = amountDecimal.StringFixed(0) list[i].Direction = utils.IntToStr(flow.Direction) list[i].CreateAt = flow.CreateAt } From b78e9cb8495880247da78f8eb6fda88db5e4dbed Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 15:58:47 +0800 Subject: [PATCH 2/9] update egg score --- app/svc/svc_points_center.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/svc/svc_points_center.go b/app/svc/svc_points_center.go index 5c8c603..9306a95 100644 --- a/app/svc/svc_points_center.go +++ b/app/svc/svc_points_center.go @@ -92,9 +92,11 @@ func GetEggPointRecordBase(now time.Time, uid int64, page int, limit int) ([]md. for i := 0; i < limit; i++ { var tempDays int if getLastWeek { - tempDays = 7 * ((page-1)*limit + i + 1) + // 未到周三下午两点,从上上周开始查询 + tempDays = 7 * ((page-1)*limit + i + 2) } else { - tempDays = 7 * ((page-1)*limit + i) + // 已过周三下午两点,从上周开始查询 + tempDays = 7 * ((page-1)*limit + i + 1) } tempTime := now.AddDate(0, 0, -tempDays) tempYear, tempWeek := tempTime.ISOWeek() From edd9d85b37bb12df46860f41dc8be348e9eec4e3 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 16:01:03 +0800 Subject: [PATCH 3/9] update rule --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 75f68b8..3f7d7b4 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241211055111-7c47b67b46d2 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241212061625-6194cb8f4125 + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241212075956-ecd20b280216 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 799c052779d3d111e43491107f22dac8da6e5227 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 17:40:33 +0800 Subject: [PATCH 4/9] update --- app/hdl/hdl_wallet.go | 3 +-- app/svc/svc_withdraw_apply.go | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/hdl/hdl_wallet.go b/app/hdl/hdl_wallet.go index a64d053..400dfaa 100644 --- a/app/hdl/hdl_wallet.go +++ b/app/hdl/hdl_wallet.go @@ -362,8 +362,7 @@ func GetWithdrawCondition(c *gin.Context) { //1. 判断是否为第一次提现 isFirst := false - has, err := db.Db.Where("uid = ?", user.Id). - Get(model.FinWithdrawApply{}) + has, err := db.Db.Where("uid = ?", user.Id).Get(model.FinWithdrawApply{}) if !has { //第一次提现 isFirst = true } diff --git a/app/svc/svc_withdraw_apply.go b/app/svc/svc_withdraw_apply.go index dbb16e1..b6f39d6 100644 --- a/app/svc/svc_withdraw_apply.go +++ b/app/svc/svc_withdraw_apply.go @@ -250,6 +250,8 @@ func GetWithdrawCondition(user *model.User, setting *model.FinWithdrawSetting, i utils.Unserialize([]byte(setting.FirstWithdrawSet), &firstWithdrawSet) if firstWithdrawSet.IsNeedRealName == 0 { resp.IsNeedRealName = false + resp.IsCanWithdraw = true + resp.NotWithdrawReason = "" } } From cbad131c3d8cd32ee96fb0d645604888a18992db Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 12 Dec 2024 17:47:33 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_config.go | 2 +- app/hdl/hdl_user.go | 6 ++++-- app/md/md_mq.go | 3 ++- go.mod | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/hdl/hdl_config.go b/app/hdl/hdl_config.go index 705bcaa..f4c6397 100644 --- a/app/hdl/hdl_config.go +++ b/app/hdl/hdl_config.go @@ -41,7 +41,7 @@ func Config(c *gin.Context) { privacyArticle, _ := NewArticleDb.GetArticle("114") if privacyArticle != nil { res.PrivacyTitle = privacyArticle.Title - res.PrivacyUrl = fmt.Sprintf("%s%s?id=%s&is_hide=1", svc.GetSysCfgStr("wap_host"), "/#/pages/course-detail-page/course-detail-page", utils.AnyToString(userArticle.Id)) + res.PrivacyUrl = fmt.Sprintf("%s%s?id=%s&is_hide=1", svc.GetSysCfgStr("wap_host"), "/#/pages/course-detail-page/course-detail-page", utils.AnyToString(privacyArticle.Id)) } res.OssUrl = svc.GetOssDomain() appCloudBundleData := svc.GetSysCfgStr("app_cloud_bundle_data") diff --git a/app/hdl/hdl_user.go b/app/hdl/hdl_user.go index 32bb210..c462af1 100644 --- a/app/hdl/hdl_user.go +++ b/app/hdl/hdl_user.go @@ -362,11 +362,13 @@ func Delete(c *gin.Context) { if err == nil { defer ch.Release() err = ch.PublishV2(md.EggUserExchange, md.CommUserId{ - Uid: utils.Int64ToStr(user.Id), + Uid: utils.Int64ToStr(user.Id), + ParentUid: utils.Int64ToStr(user.ParentUid), }, md.EggUserDelete) if err != nil { ch.PublishV2(md.EggUserExchange, md.CommUserId{ - Uid: utils.Int64ToStr(user.Id), + Uid: utils.Int64ToStr(user.Id), + ParentUid: utils.Int64ToStr(user.ParentUid), }, md.EggUserDelete) } } diff --git a/app/md/md_mq.go b/app/md/md_mq.go index 8292fea..05d6ba5 100644 --- a/app/md/md_mq.go +++ b/app/md/md_mq.go @@ -22,7 +22,8 @@ type PlayletReward struct { Uid string `json:"uid"` } type CommUserId struct { - Uid string `json:"uid"` + Uid string `json:"uid"` + ParentUid string `json:"parent_uid"` } type JpushRecordFundData struct { Id string `json:"id"` diff --git a/go.mod b/go.mod index d883a8b..f943f46 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.20.0 github.com/go-redis/redis v6.15.9+incompatible - github.com/gomodule/redigo v1.9.2 + github.com/gomodule/redigo v2.0.0+incompatible github.com/jinzhu/copier v0.4.0 github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 github.com/qiniu/api.v7/v7 v7.8.2 @@ -37,6 +37,7 @@ require ( 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 + github.com/gin-contrib/sessions v1.0.1 github.com/go-pay/crypto v0.0.1 github.com/go-pay/gopay v1.5.101 github.com/go-pay/xlog v0.0.2 @@ -76,6 +77,7 @@ require ( github.com/clbanning/mxj/v2 v2.5.5 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -100,7 +102,6 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/nxadm/tail v1.4.8 // indirect github.com/pelletier/go-toml/v2 v2.2.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect From dfa71522e2bb41c9bef995fe728f8cdf9e82dbae Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 12 Dec 2024 19:10:38 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/task/svc/svc_no_login_send.go | 20 ++++++++++++-------- app/task/svc/svc_no_sign_send.go | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/task/svc/svc_no_login_send.go b/app/task/svc/svc_no_login_send.go index 7be91fa..8caf528 100644 --- a/app/task/svc/svc_no_login_send.go +++ b/app/task/svc/svc_no_login_send.go @@ -57,15 +57,19 @@ WHERE unt.login_time<'%d' and unt.login_notice_time<'%d' and unt.login_time>0 %s data.Content = strings.ReplaceAll(data.Content, "{手机号}", v["phone"]) data.Content = strings.ReplaceAll(data.Content, "{小时}", utils.Int64ToStr(hour)) extra = "{\"hour\":\"" + utils.Int64ToStr(hour) + "\"}" - arg := md.JpushRecordFundData{UserId: v["id"], Target: "1", Platform: "all", Title: data.Title, Content: data.Content} - err := ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) - if err != nil { - ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) + if data.JpushOpen == 1 { + arg := md.JpushRecordFundData{UserId: v["id"], Target: "1", Platform: "all", Title: data.Title, Content: data.Content} + err := ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) + if err != nil { + ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) + } } - arg1 := md.AliyunSmsRecordFundData{Phone: v["phone"], Title: data.Title, Content: data.Content, Code: data.SmsCode, Extra: extra} - err = ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) - if err != nil { - ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) + if data.SmsOpen == 1 { + arg1 := md.AliyunSmsRecordFundData{Phone: v["phone"], Title: data.Title, Content: data.Content, Code: data.SmsCode, Extra: extra} + err := ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) + if err != nil { + ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) + } } eg.Where("id=?", v["unt_id"]).Cols("login_notice_time").Update(&model.UserNoticeTime{LoginNoticeTime: int(time.Now().Unix())}) } diff --git a/app/task/svc/svc_no_sign_send.go b/app/task/svc/svc_no_sign_send.go index e47aff3..cb1c8f9 100644 --- a/app/task/svc/svc_no_sign_send.go +++ b/app/task/svc/svc_no_sign_send.go @@ -56,15 +56,19 @@ WHERE unt.sign_time<'%d' and unt.sign_notice_time<'%d' and unt.sign_time>0 %s data.Content = strings.ReplaceAll(data.Content, "{手机号}", v["phone"]) data.Content = strings.ReplaceAll(data.Content, "{小时}", utils.Int64ToStr(hour)) extra = "{\"hour\":\"" + utils.Int64ToStr(hour) + "\"}" - arg := md.JpushRecordFundData{UserId: v["id"], Target: "1", Platform: "all", Title: data.Title, Content: data.Content} - err := ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) - if err != nil { - ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) + if data.JpushOpen == 1 { + arg := md.JpushRecordFundData{UserId: v["id"], Target: "1", Platform: "all", Title: data.Title, Content: data.Content} + err := ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) + if err != nil { + ch.PublishV2(md.EggJpushRecordQueueExchange, arg, md.EggJpushRecordQueue) + } } - arg1 := md.AliyunSmsRecordFundData{Phone: v["phone"], Title: data.Title, Content: data.Content, Code: data.SmsCode, Extra: extra} - err = ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) - if err != nil { - ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) + if data.SmsOpen == 1 { + arg1 := md.AliyunSmsRecordFundData{Phone: v["phone"], Title: data.Title, Content: data.Content, Code: data.SmsCode, Extra: extra} + err := ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) + if err != nil { + ch.PublishV2(md.EggAliyunSmsRecordQueueExchange, arg1, md.EggAliyunSmsRecordQueue) + } } eg.Where("id=?", v["unt_id"]).Cols("sign_notice_time").Update(&model.UserNoticeTime{SignNoticeTime: int(time.Now().Unix())}) } From 3eec30e26ce4b24cc1c87e1adbd10dc986726623 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 19:27:32 +0800 Subject: [PATCH 7/9] update --- app/hdl/hdl_add_friend.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index aa56d49..765d1f1 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -61,8 +61,10 @@ func EggEnergyDetails(c *gin.Context) { isAsc := false if req.Kind == "1" { // 待结 coinID = eggEnergyBasicSetting.PersonEggEnergyCoinId - } else { // 可用 + } else if req.Kind == "2" { // 可用 coinID = eggEnergyBasicSetting.TeamEggEnergyCoinId + } else { + coinID = 0 } if req.Asc == "1" { isAsc = true @@ -245,8 +247,10 @@ func EggPointDetails(c *gin.Context) { isAsc := false if req.Kind == "1" { // 待结 coinID = eggEnergyBasicSetting.PersonEggPointsCoinId - } else { // 可用 + } else if req.Kind == "2" { // 可用 coinID = eggEnergyBasicSetting.TeamEggPointsCoinId + } else { + coinID = 0 } if req.Asc == "1" { isAsc = true From bf3aeb0f034b58467ee66d2ddf7c31d4526edb15 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 19:38:07 +0800 Subject: [PATCH 8/9] update --- app/hdl/hdl_add_friend.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index 765d1f1..924d9da 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -292,12 +292,12 @@ func EggPointDetails(c *gin.Context) { } virtualAmountDb := implement.NewUserVirtualAmountDb(db.Db) var totalEggPoints float64 - personEggPoints, err := virtualAmountDb.GetUserVirtualWalletBySession(user.Id, eggEnergyBasicSetting.PersonEggEnergyCoinId) + personEggPoints, err := virtualAmountDb.GetUserVirtualWalletBySession(user.Id, eggEnergyBasicSetting.PersonEggPointsCoinId) if err != nil { e.OutErr(c, e.ERR_DB_ORM, err.Error()) return } - teamEggPoints, err := virtualAmountDb.GetUserVirtualWalletBySession(user.Id, eggEnergyBasicSetting.TeamEggEnergyCoinId) + teamEggPoints, err := virtualAmountDb.GetUserVirtualWalletBySession(user.Id, eggEnergyBasicSetting.TeamEggPointsCoinId) if err != nil { e.OutErr(c, e.ERR_DB_ORM, err.Error()) return From 51749bfcad73d5838b08ce7b74f026442e436dde Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 20:30:20 +0800 Subject: [PATCH 9/9] update --- app/hdl/hdl_add_friend.go | 10 ++++++---- app/md/md_add_friend.go | 18 +++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index 924d9da..5009681 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -410,6 +410,7 @@ func BasalRate(c *gin.Context) { ConsumedEggPoint: "0", EstimatedRevenue: "0", SignCountdown: "00:00:00", + SignTimeSecs: 0, } e.OutSuc(c, resp, nil) return @@ -448,22 +449,23 @@ func BasalRate(c *gin.Context) { basalRate := basalRateDecimal.Mul(decimal.NewFromInt(60 * 60)) // 收益倒计时 var signCountdown string - var signTimeSecs float64 + var signTimeSecs int duration := utils.TimeParseStd(eggSignIn.EndTime).Sub(now) // 计算时间差值 if duration > 0 { hours := duration / time.Hour // 获取小时部分 minutes := duration % time.Hour / time.Minute // 获取分钟部分(先除去小时后再乘以60) seconds := int64(duration/time.Second) % 60 signCountdown = fmt.Sprintf("%d:%d:%d", hours, minutes, seconds) //收益倒计时 - signTimeSecs = duration.Seconds() + signTimeSecs = int(duration.Seconds()) + } else { signCountdown = fmt.Sprintf("00:00:00") } resp := md.BasalRateResp{ - ConsumedTime: consumedTime.String(), + ConsumedTime: consumedTime.StringFixed(2), ConsumedEggEnergy: consumedEggEnergy.String(), - RemainingTime: remainingTime.String(), + RemainingTime: remainingTime.StringFixed(2), RemainingEggEnergy: remainingEggEnergy.String(), BasalRate: basalRate.String(), ConsumedEggPoint: eggSignIn.TotalPersonEggPoints, diff --git a/app/md/md_add_friend.go b/app/md/md_add_friend.go index d28ceff..d6890ce 100644 --- a/app/md/md_add_friend.go +++ b/app/md/md_add_friend.go @@ -87,15 +87,15 @@ type NineDimensionalSpaceResp struct { } type BasalRateResp struct { - ConsumedTime string `json:"consumed_time"` // 消耗时间/小时 - ConsumedEggEnergy string `json:"consumed_egg_energy"` // 收益蛋蛋能量 - RemainingTime string `json:"remaining_time"` // 剩余时间/小时 - RemainingEggEnergy string `json:"remaining_egg_energy"` // 剩余蛋蛋能量 - BasalRate string `json:"basal_rate"` // 基础速率 - ConsumedEggPoint string `json:"consumed_egg_point"` // 消耗蛋蛋积分 - EstimatedRevenue string `json:"estimated_revenue"` // 预估收益蛋蛋能量 - SignCountdown string `json:"sign_countdown"` // 收益倒计时 - SignTimeSecs float64 `json:"sign_time_secs"` // 收益倒计时秒数 + ConsumedTime string `json:"consumed_time"` // 消耗时间/小时 + ConsumedEggEnergy string `json:"consumed_egg_energy"` // 收益蛋蛋能量 + RemainingTime string `json:"remaining_time"` // 剩余时间/小时 + RemainingEggEnergy string `json:"remaining_egg_energy"` // 剩余蛋蛋能量 + BasalRate string `json:"basal_rate"` // 基础速率 + ConsumedEggPoint string `json:"consumed_egg_point"` // 消耗蛋蛋积分 + EstimatedRevenue string `json:"estimated_revenue"` // 预估收益蛋蛋能量 + SignCountdown string `json:"sign_countdown"` // 收益倒计时 + SignTimeSecs int `json:"sign_time_secs"` // 收益倒计时秒数 } type TotalRateResp struct {