From 9cc43287068aaa4f5692df1d8657a5ddc493e29d Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 25 Sep 2019 09:37:41 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=B1=8F=E8=94=BDStoreRange=E8=B6=8A?= =?UTF-8?q?=E7=95=8C=E5=BC=82=E6=AD=A5=EF=BC=8C=E6=89=93=E5=8D=B0=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/misc/store_score.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/business/jxstore/misc/store_score.go b/business/jxstore/misc/store_score.go index e2a2985d4..7079b5966 100644 --- a/business/jxstore/misc/store_score.go +++ b/business/jxstore/misc/store_score.go @@ -16,6 +16,7 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/refutil" ) @@ -475,6 +476,13 @@ func ScoreStoreRange(storeInfo *cms.StoreExt) { finalScore = ItemTotalScore - int(math.Round(diff*ratio)) } } + if finalScore < 0 { + globals.SugarLogger.Infof("ScoreStoreRange abnormal finalScore:%d, storeInfo:%s", finalScore, utils.Format4Output(storeInfo, true)) + finalScore = 0 + } else if finalScore > ItemTotalScore { + globals.SugarLogger.Infof("ScoreStoreRange abnormal finalScore:%d, storeInfo:%s", finalScore, utils.Format4Output(storeInfo, true)) + finalScore = ItemTotalScore + } storeScoreDataWrapper.SetData(storeID, model.FieldStoreRange, finalScore) }