支付和广告调试
This commit is contained in:
@@ -85,7 +85,7 @@ func New_CurrencyList(ctx context.Context, uid uint64, sysType string, t commod.
|
||||
moneys = append(moneys, FenToYuan(c.Price))
|
||||
}
|
||||
|
||||
req := rchgutil.GainPayTypeReq{Money: moneys}
|
||||
req := rchgutil.GainPayTypeReq{Money: moneys, DevType: sysType, DistrictCode: userDistrictCode(uid)}
|
||||
bc, err := req.GetPayType()
|
||||
if err != nil {
|
||||
log.ErrorX(ctx, "获取支付通道列表异常", log.Any("moneys", moneys), log.Any("sysType", sysType),
|
||||
@@ -119,6 +119,18 @@ func New_CurrencyList(ctx context.Context, uid uint64, sysType string, t commod.
|
||||
return data, stderr.Success
|
||||
}
|
||||
|
||||
// userDistrictCode 获取用户渠道码,查询失败按空渠道码处理
|
||||
func userDistrictCode(uid uint64) string {
|
||||
if uid == 0 {
|
||||
return ""
|
||||
}
|
||||
u, err := usermod.FindUserByUID(uid)
|
||||
if err != nil || u == nil {
|
||||
return ""
|
||||
}
|
||||
return u.DistrictCode
|
||||
}
|
||||
|
||||
// getChannelDisplayName 获取支付渠道显示名称
|
||||
func getChannelDisplayName(pType string) string {
|
||||
channelNames := map[string]string{
|
||||
@@ -283,7 +295,7 @@ func New_ProductList(uid uint64, sysType string, newUser bool, proT int) (res []
|
||||
moneys := GetUniqueMoneys(data)
|
||||
|
||||
// 缓存支付通道信息
|
||||
req := rchgutil.GainPayTypeReq{Money: moneys}
|
||||
req := rchgutil.GainPayTypeReq{Money: moneys, DevType: sysType, DistrictCode: userDistrictCode(uid)}
|
||||
bc, err := req.GetPayTypeFromCache()
|
||||
if err != nil {
|
||||
log.Warn(fmt.Sprintf("用户ID:%d;rchgutil GetPayType:%v", uid, err))
|
||||
|
||||
Reference in New Issue
Block a user