From f3dffd7db87110b24fa4cb3c61cc91297a06a04e Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 23 May 2022 15:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/models.go | 2 +- models/user_business_analysis.go | 8 ++++---- routers/repo/user_data_analysis.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/models/models.go b/models/models.go index 9d255c5e6..46444c58b 100755 --- a/models/models.go +++ b/models/models.go @@ -157,7 +157,7 @@ func init() { new(UserBusinessAnalysisCurrentMonth), new(UserBusinessAnalysisCurrentWeek), new(UserBusinessAnalysisYesterday), - new(UserBusinessAnalysisLastWeek), + //new(UserBusinessAnalysisLastWeek), new(UserLoginLog), new(UserMetrics), new(UserAnalysisPara), diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index b986baab5..2984fdc3f 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -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)) } diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 65764d58a..430c8b2cc 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -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()