Browse Source

提交代码。

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

+ 1
- 1
models/models.go View File

@@ -157,7 +157,7 @@ func init() {
new(UserBusinessAnalysisCurrentMonth),
new(UserBusinessAnalysisCurrentWeek),
new(UserBusinessAnalysisYesterday),
new(UserBusinessAnalysisLastWeek),
//new(UserBusinessAnalysisLastWeek),
new(UserLoginLog),
new(UserMetrics),
new(UserAnalysisPara),


+ 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()
@@ -457,7 +457,7 @@ func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wi
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
@@ -531,7 +531,7 @@ func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wi
break
}
}
log.Info("query user define,count=" + fmt.Sprint((ResultList)))
return ResultList, int64(len(ResultList))
}



+ 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