Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.5.2
zouap 3 years ago
parent
commit
16ad0e8042
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      models/user_business_analysis.go
  2. +2
    -2
      routers/repo/user_data_analysis.go

+ 4
- 4
models/user_business_analysis.go View File

@@ -407,7 +407,7 @@ func QueryUserStaticDataAll(opts *UserBusinessAnalysisQueryOptions) ([]*UserBusi
return userBusinessAnalysisReturnList, allCount
}

func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wikiCountMap map[string]int) ([]UserBusinessAnalysis, int64) {
func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wikiCountMap map[string]int) ([]*UserBusinessAnalysis, int64) {
log.Info("start to count other user info data")
sess := x.NewSession()
defer sess.Close()
@@ -453,11 +453,11 @@ func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wi
statictisSess := xStatistic.NewSession()
defer statictisSess.Close()

cond := "type != 1 and and is_active=true"
cond := "type != 1 and is_active=true"
count, err := sess.Where(cond).Count(new(User))

ParaWeight := getParaWeight()
ResultList := make([]UserBusinessAnalysis, 0)
ResultList := make([]*UserBusinessAnalysis, 0)
var indexTotal int64
indexTotal = 0
for {
@@ -523,7 +523,7 @@ func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wi
dateRecord.RecommendImage = getMapValue(dateRecord.ID, RecommendImage)

dateRecord.UserIndexPrimitive = getUserIndex(dateRecord, ParaWeight)
ResultList = append(ResultList, dateRecord)
ResultList = append(ResultList, &dateRecord)
}

indexTotal += PAGE_SIZE


+ 2
- 2
routers/repo/user_data_analysis.go View File

@@ -189,7 +189,7 @@ func writeExcel(row int, xlsx *excelize.File, sheetName string, userRecord *mode
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime)
}

func writeExcelPage(row int, xlsx *excelize.File, sheetName string, userRecord models.UserBusinessAnalysis) {
func writeExcelPage(row int, xlsx *excelize.File, sheetName string, userRecord *models.UserBusinessAnalysis) {
rows := fmt.Sprint(row)
var tmp byte
tmp = 0
@@ -592,7 +592,7 @@ func QueryUserStaticDataPage(ctx *context.Context) {
}
}

func writeFileToDisk(ctx *context.Context, count int64, re []models.UserBusinessAnalysis, filename string) {
func writeFileToDisk(ctx *context.Context, count int64, re []*models.UserBusinessAnalysis, filename string) {
log.Info("return count=" + fmt.Sprint(count))
//writer exec file.
xlsx := excelize.NewFile()


Loading…
Cancel
Save