Update:更新余量字段获取
This commit is contained in:
parent
48e0bdd93d
commit
669e5377bb
@ -786,6 +786,11 @@ func PayLaterBundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.Pa
|
||||
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (*bundle.GetBundleBalanceLayoutResp, error) {
|
||||
data, err := dao.GetBundleBalanceLayout(req)
|
||||
if err != nil { // 返回默认值
|
||||
if req.BundleType == 2 {
|
||||
return &bundle.GetBundleBalanceLayoutResp{
|
||||
Data: buildDefaultPayLaterBalanceLayout(),
|
||||
}, nil
|
||||
}
|
||||
return &bundle.GetBundleBalanceLayoutResp{
|
||||
Data: buildDefaultBalanceLayout(),
|
||||
}, nil
|
||||
@ -906,3 +911,39 @@ func buildDefaultBalanceLayout() string {
|
||||
b, _ := json.Marshal(jsonMap)
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func buildDefaultPayLaterBalanceLayout() string {
|
||||
var data = []struct {
|
||||
Title string
|
||||
Column string
|
||||
Status int
|
||||
}{
|
||||
{"是否激活", "activate", 1},
|
||||
{"艺人", "userName", 1},
|
||||
{"艺人手机号", "userPhoneNumber", 1},
|
||||
{"用户编号", "customerNum", 1},
|
||||
{"最后购买的套餐", "bundleName", 1},
|
||||
{"下单时间", "payTime", 1},
|
||||
{"过期时间", "expiredTime", 1},
|
||||
{"视频总数", "bundleVideoSumNumber", 1},
|
||||
{"可用视频数", "bundleVideoNumber", 1},
|
||||
{"已用视频数", "bundleVideoConsumptionNumber", 1},
|
||||
{"作废视频数", "bundleVideoInvalidNumber", 1},
|
||||
{"当月可用视频数", "monthlyBundleVideoNumber", 1},
|
||||
{"当月已用视频数", "monthlyBundleVideoConsumptionNumber", 1},
|
||||
{"当月作废视频数", "monthlyBundleVideoInvalidNumber", 1},
|
||||
}
|
||||
jsonMap := []map[string]any{}
|
||||
for _, v := range data {
|
||||
jsonMap = append(jsonMap, map[string]any{
|
||||
"sort": 1,
|
||||
"fieldKey": v.Column,
|
||||
"fieldValue": v.Title,
|
||||
"sortOrNot": true,
|
||||
"status": v.Status,
|
||||
"width": 160,
|
||||
})
|
||||
}
|
||||
b, _ := json.Marshal(jsonMap)
|
||||
return string(b)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user