fix: 添加状态条件过滤

This commit is contained in:
renzhiyuan 2026-01-16 09:15:07 +08:00
parent b3c807f0ac
commit ecd2490a24
2 changed files with 6 additions and 1 deletions

View File

@ -452,6 +452,11 @@ func (g *GroupConfigBiz) GetReportCache(ctx context.Context, day time.Time, tota
v.Manager = ResellerProductRelation[v.ResellerId].AfterSaleName v.Manager = ResellerProductRelation[v.ResellerId].AfterSaleName
for _, vv := range v.ProductLoss { for _, vv := range v.ProductLoss {
if _, ex := ResellerProductRelation[v.ResellerId].Products[vv.ProductId]; !ex { if _, ex := ResellerProductRelation[v.ResellerId].Products[vv.ProductId]; !ex {
vv.LossReason = "未填写"
continue
}
if len(ResellerProductRelation[v.ResellerId].Products[vv.ProductId].LossReason) == 0 {
vv.LossReason = "未填写"
continue continue
} }
vv.LossReason = ResellerProductRelation[v.ResellerId].Products[vv.ProductId].LossReason vv.LossReason = ResellerProductRelation[v.ResellerId].Products[vv.ProductId].LossReason

View File

@ -263,7 +263,7 @@ func (b *BbxtTools) GetResellerLossMannagerAndLossReasonFromApi(ctx context.Cont
for _, product := range v.ProductLoss { for _, product := range v.ProductLoss {
relationMap[v.ResellerId].Products[product.ProductId] = &LossReason{ relationMap[v.ResellerId].Products[product.ProductId] = &LossReason{
ProductName: product.ProductName, ProductName: product.ProductName,
LossReason: "未填写", // 初始化为未填写 LossReason: "", // 初始化为未填写
} }
} }
} }