@@ -344,6 +344,9 @@ func GetWithdrawApplyList(c *gin.Context) { | |||||
PayAt: apply.UpdateAt, | PayAt: apply.UpdateAt, | ||||
Memo: apply.Memo, | Memo: apply.Memo, | ||||
} | } | ||||
if apply.CustomInviteCode != "" { | |||||
list[i].InviteCode = apply.CustomInviteCode | |||||
} | |||||
if apply.Amount != "" && apply.Fee != "" { | if apply.Amount != "" && apply.Fee != "" { | ||||
actualReceipt := utils.StrToFloat64(apply.Amount) - utils.StrToFloat64(apply.Fee) | actualReceipt := utils.StrToFloat64(apply.Amount) - utils.StrToFloat64(apply.Fee) | ||||
list[i].ActualReceipt = utils.Float64ToStr(actualReceipt) | list[i].ActualReceipt = utils.Float64ToStr(actualReceipt) | ||||
@@ -131,6 +131,12 @@ func UserManagementGetUserList(c *gin.Context) { | |||||
State: user.State, | State: user.State, | ||||
LastLoginAt: user.UpdateAt, | LastLoginAt: user.UpdateAt, | ||||
} | } | ||||
if user.CustomInviteCode != "" { | |||||
list[i].InviteCode = user.CustomInviteCode | |||||
} | |||||
if user.ParentCustomInviteCode != "" { | |||||
list[i].ParentInviteCode = user.ParentCustomInviteCode | |||||
} | |||||
var tempTagList []md.TagNode | var tempTagList []md.TagNode | ||||
list[i].Tag = tempTagList | list[i].Tag = tempTagList | ||||
userMap[user.Id] = i | userMap[user.Id] = i | ||||
@@ -87,6 +87,7 @@ type WithdrawApplyInfo struct { | |||||
WxPayName string `xorm:"wx_user_name"` // 微信昵称 | WxPayName string `xorm:"wx_user_name"` // 微信昵称 | ||||
WxPayAccount string `xorm:"wx_user_id"` // 微信账号 | WxPayAccount string `xorm:"wx_user_id"` // 微信账号 | ||||
InviteCode string `xorm:"system_invite_code"` // 邀请码 | InviteCode string `xorm:"system_invite_code"` // 邀请码 | ||||
CustomInviteCode string `xorm:"custom_invite_code"` // 自定义邀请码 | |||||
} | } | ||||
type GetWithdrawApplyListResp struct { | type GetWithdrawApplyListResp struct { | ||||
@@ -72,8 +72,10 @@ func QueryElasticsearch(req md2.UserEggFlowReq, indexName string) (resp []md2.Us | |||||
From((req.Page - 1) * req.PageSize).Size(req.PageSize). | From((req.Page - 1) * req.PageSize).Size(req.PageSize). | ||||
Pretty(true). | Pretty(true). | ||||
Do(context.Background()) | Do(context.Background()) | ||||
if err != nil { | if err != nil { | ||||
if strings.Contains(err.Error(), "no such index") { | |||||
return nil, 0, nil | |||||
} | |||||
return | return | ||||
} | } | ||||
@@ -82,7 +82,9 @@ func WithDrawManagementGetApply(engine *xorm.Engine, req *md.GetWithdrawApplyLis | |||||
if req.Level != "" { | if req.Level != "" { | ||||
session = session.Where("usera.level = ?", req.Level) | session = session.Where("usera.level = ?", req.Level) | ||||
} | } | ||||
total, err := session.Select("apply.*, alipay.open_id as alipay_open_id, alipay.user_name as alipay_user_name, wx.user_id as wx_user_id, wx.user_name as wx_user_name, usera.system_invite_code as system_invite_code"). | |||||
total, err := session.Select("apply.*, alipay.open_id as alipay_open_id, alipay.user_name as alipay_user_name,"+ | |||||
" wx.user_id as wx_user_id, wx.user_name as wx_user_name,"+ | |||||
" usera.system_invite_code as system_invite_code, usera.custom_invite_code as custom_invite_code"). | |||||
Limit(req.Limit, (req.Page-1)*req.Limit).Asc("apply.id").FindAndCount(&applies) | Limit(req.Limit, (req.Page-1)*req.Limit).Asc("apply.id").FindAndCount(&applies) | ||||
if err != nil { | if err != nil { | ||||
return nil, 0, err | return nil, 0, err | ||||