Browse Source

修改下载报告及界面所有用户的Bug

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1
zouap 3 years ago
parent
commit
13f103c318
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      models/user_business_analysis.go

+ 3
- 5
models/user_business_analysis.go View File

@@ -199,17 +199,16 @@ func QueryUserStaticDataPage(opts *UserBusinessAnalysisQueryOptions) ([]*UserBus
}
statictisSess.Limit(opts.PageSize, start)
}
statictisSess.OrderBy("count_date desc")

userBusinessAnalysisList := make([]*UserBusinessAnalysis, 0)
if err := statictisSess.Table("user_business_analysis").Where(cond).
if err := statictisSess.Table("user_business_analysis").Where(cond).OrderBy("count_date desc").
Find(&userBusinessAnalysisList); err != nil {
return nil, 0
}

resultMap := make(map[int64]*UserBusinessAnalysis)

if opts.Page >= 0 && opts.PageSize > 0 && len(userBusinessAnalysisList) > 0 {
if len(userBusinessAnalysisList) > 0 {
var newAndCond = builder.NewCond()
var newOrCond = builder.NewCond()
for _, userRecord := range userBusinessAnalysisList {
@@ -228,9 +227,8 @@ func QueryUserStaticDataPage(opts *UserBusinessAnalysisQueryOptions) ([]*UserBus
builder.Lte{"count_date": opts.EndTime},
)
}

userBusinessAnalysisList = make([]*UserBusinessAnalysis, 0)
if err := statictisSess.Table("user_business_analysis").Where(newAndCond).
if err := statictisSess.Table("user_business_analysis").Where(newAndCond).OrderBy("count_date desc").
Find(&userBusinessAnalysisList); err != nil {
return nil, 0
}


Loading…
Cancel
Save