From 7eff77ed4b2bc3b9779b0b3d43d1a3c09ba3c77e Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 23 Sep 2024 17:23:24 +0800 Subject: [PATCH] 1 --- app/agent/svc/svc_store.go | 4 ++-- app/db/model/community_team_store_withdraw_apply.go | 6 +++--- app/store/hdl/hdl_store.go | 9 +++++---- app/store/svc/svc_login.go | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/agent/svc/svc_store.go b/app/agent/svc/svc_store.go index 4a56c94..5dae7ee 100644 --- a/app/agent/svc/svc_store.go +++ b/app/agent/svc/svc_store.go @@ -30,7 +30,7 @@ func StoreWithdrawFlow(c *gin.Context) { name = store.Name } tmp := map[string]string{ - "id": utils.Int64ToStr(v.Id), + "id": utils.IntToStr(v.Id), "name": name, "amount": v.Amount, "alipay_account": v.WithdrawAccount, @@ -41,7 +41,7 @@ func StoreWithdrawFlow(c *gin.Context) { "end_time": "", "memo": v.Memo, } - if v.PaymentDate != "" { + if v.PaymentDate != "" && v.PaymentDate != "0000-00-00 00:00:00" { tmp["end_time"] = v.PaymentDate } list = append(list, tmp) diff --git a/app/db/model/community_team_store_withdraw_apply.go b/app/db/model/community_team_store_withdraw_apply.go index 023afb4..92e66c5 100644 --- a/app/db/model/community_team_store_withdraw_apply.go +++ b/app/db/model/community_team_store_withdraw_apply.go @@ -5,12 +5,11 @@ import ( ) type CommunityTeamStoreWithdrawApply struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` Uid int `json:"uid" xorm:"not null default 0 comment('用户ID') index INT(10)"` Amount string `json:"amount" xorm:"not null default 0.00 comment('提现金额') DECIMAL(10,2)"` Memo string `json:"memo" xorm:"not null default '' comment('备注,失败请备注原因') VARCHAR(500)"` Type int `json:"type" xorm:"not null default 1 comment('提现类型;1:手动;2:自动') TINYINT(1)"` - ParentUid int `json:"parent_uid" xorm:"not null default 1 comment('提现类型;1:手动;2:自动') TINYINT(1)"` WithdrawAccount string `json:"withdraw_account" xorm:"not null default '' comment('提现账号') VARCHAR(64)"` WithdrawName string `json:"withdraw_name" xorm:"not null default '' comment('提现人姓名') VARCHAR(12)"` Reason int `json:"reason" xorm:"not null default 0 comment('审核失败(驳回理由);1:当前账号不满足提现规则;2:账号异常;3:资金异常') TINYINT(1)"` @@ -18,6 +17,7 @@ type CommunityTeamStoreWithdrawApply struct { CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('申请时间') index TIMESTAMP"` UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('处理时间') TIMESTAMP"` State int `json:"state" xorm:"not null default 0 comment('0申请中,1通过,2完成,3失败') TINYINT(1)"` - Oid int64 `json:"oid" xorm:"not null default 0 comment('0申请中,1通过,2完成,3失败') TINYINT(1)"` Platform string `json:"platform" xorm:"VARCHAR(255)"` + ParentUid int `json:"parent_uid" xorm:"default 0 INT(11)"` + Oid int64 `json:"oid" xorm:"BIGINT(20)"` } diff --git a/app/store/hdl/hdl_store.go b/app/store/hdl/hdl_store.go index 7b8a055..6052c9d 100644 --- a/app/store/hdl/hdl_store.go +++ b/app/store/hdl/hdl_store.go @@ -314,7 +314,7 @@ func UserStoreInfoSet(c *gin.Context) { store := db.GetStoreIdEg(svc.MasterDb(c), utils.IntToStr(user.Info.Uid)) if store == nil { store = &model.CommunityTeamStore{ - Uid: int(utils.AnyToInt64(arg["uid"])), + Uid: user.Info.Uid, CreateAt: time.Now(), UpdateAt: time.Now(), State: 1, @@ -373,8 +373,8 @@ func UserStoreBanner(c *gin.Context) { e.OutErr(c, e.ERR_INVALID_ARGS, err) return } - - uid := utils.StrToInt(arg["uid"]) + user := svc.GetUser(c) + uid := user.Info.Uid activity := db.GetUserStoreActivity(svc.MasterDb(c), arg["type"], uid) data := make([]map[string]string, 0) if activity != nil { @@ -434,10 +434,11 @@ func UserStoreBannerSave(c *gin.Context) { return } + user := svc.GetUser(c) data := model.UserStoreActivity{} if arg["id"] == "" { data = model.UserStoreActivity{ - Uid: utils.StrToInt(arg["uid"]), + Uid: user.Info.Uid, Type: arg["type"], Time: time.Now(), } diff --git a/app/store/svc/svc_login.go b/app/store/svc/svc_login.go index e764c54..3ead1d6 100644 --- a/app/store/svc/svc_login.go +++ b/app/store/svc/svc_login.go @@ -391,7 +391,7 @@ func Sms(c *gin.Context) { } user := svc.GetUser(c) req["phone"] = user.Info.Phone - types := "bind_alipay" + types := req["type"] var err error smsType := svc.SysCfgGet(c, "sms_type") c.Set("sms_type", smsType)