From f88b273f925b06ad51f956c472bb9044dfbe3d4e Mon Sep 17 00:00:00 2001 From: Rosy-zhudan Date: Mon, 16 Sep 2019 17:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9SQL=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/dao/store_score.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/business/model/dao/store_score.go b/business/model/dao/store_score.go index 142d3525d..e144a1cbb 100644 --- a/business/model/dao/store_score.go +++ b/business/model/dao/store_score.go @@ -16,7 +16,7 @@ func GetLatestWeeklyStoreScoreList(db *DaoDB, storeID, weekNum int) (storeScoreL SELECT t2.name store_name, t1.* FROM store_score t1 JOIN store t2 ON t1.store_id = t2.id WHERE t1.store_id = ? - AND DATE(t1.ScoreDate) >= DATE_SUB( + AND DATE(t1.score_date) >= DATE_SUB( DATE_SUB( CURDATE(), INTERVAL @@ -28,7 +28,7 @@ func GetLatestWeeklyStoreScoreList(db *DaoDB, storeID, weekNum int) (storeScoreL ), INTERVAL ? DAY ) - AND DATE(t1.ScoreDate) <= DATE_SUB( + AND DATE(t1.score_date) <= DATE_SUB( CURDATE(), INTERVAL IF ( @@ -37,7 +37,7 @@ func GetLatestWeeklyStoreScoreList(db *DaoDB, storeID, weekNum int) (storeScoreL DAYOFWEEK(CURDATE()) - 1 ) DAY ) - ORDER BY ScoreDate DESC + ORDER BY score_date DESC ` if weekNum <= 0 { weekNum = 1