From 20ebb1970cf2330981ad1c439c2cc950fb40fcf8 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 29 Sep 2021 16:42:09 +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/user_business_analysis.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 84288bdff..b17b7a58b 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -68,6 +68,8 @@ func countData() { sess.Find(&userList) currentTimeNow := time.Now() + log.Info("current time:" + currentTimeNow.Format("2000-01-01 10:10:10")) + yesterday := currentTimeNow.AddDate(0, 0, -1) startTime := time.Date(yesterday.Year(), yesterday.Month(), yesterday.Day(), 0, 0, 0, 0, yesterday.Location()) start_unix := startTime.Unix() @@ -76,6 +78,7 @@ func countData() { endTime := time.Date(currentTimeNow.Year(), currentTimeNow.Month(), currentTimeNow.Day(), 0, 0, 0, 0, currentTimeNow.Location()) end_unix := endTime.Unix() + CountDate := time.Date(currentTimeNow.Year(), currentTimeNow.Month(), currentTimeNow.Day(), 0, 1, 0, 0, currentTimeNow.Location()) //codeMergeCountMap := queryAction(start_unix,end_unix,11) CodeMergeCountMap := queryAction(start_unix, end_unix, 11) @@ -86,7 +89,7 @@ func countData() { var dateRecord UserBusinessAnalysis dateRecord.ID = userRecord.ID log.Info("i=" + fmt.Sprint(i) + " userName=" + userRecord.Name) - dateRecord.CountDate = time.Now().Unix() + dateRecord.CountDate = CountDate.Unix() dateRecord.Email = userRecord.Email dateRecord.RegistDate = userRecord.CreatedUnix