|
|
@@ -412,12 +412,12 @@ func QueryUserStaticDataAll(opts *UserBusinessAnalysisQueryOptions) ([]*UserBusi |
|
|
|
func QueryDataForUserDefineFromDb(opts *UserBusinessAnalysisQueryOptions, key string) ([]*UserBusinessAnalysis, int64) { |
|
|
|
statictisSess := xStatistic.NewSession() |
|
|
|
defer statictisSess.Close() |
|
|
|
|
|
|
|
allCount, err := statictisSess.Where("data_date=" + key).Count(new(UserBusinessAnalysis)) |
|
|
|
cond := "data_date='" + key + "'" |
|
|
|
allCount, err := statictisSess.Where(cond).Count(new(UserBusinessAnalysis)) |
|
|
|
if err == nil { |
|
|
|
if allCount > 0 { |
|
|
|
userBusinessAnalysisList := make([]*UserBusinessAnalysis, 0) |
|
|
|
if err := statictisSess.Table("user_business_analysis").Where("data_date="+key).OrderBy("id desc").Limit(opts.PageSize, (opts.Page-1)*opts.PageSize). |
|
|
|
if err := statictisSess.Table("user_business_analysis").Where(cond).OrderBy("id desc").Limit(opts.PageSize, (opts.Page-1)*opts.PageSize). |
|
|
|
Find(&userBusinessAnalysisList); err != nil { |
|
|
|
return nil, 0 |
|
|
|
} |
|
|
|