From cf9c58799c879c3dfea4bfe7447caf637593252b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 8 Jan 2021 16:06:54 +0800 Subject: [PATCH] aa --- business/model/dao/dao_order.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index a7ab7e920..f45b62125 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -453,7 +453,11 @@ func GetManageStatistics(db *DaoDB, cityCodes []int, jobTime time.Time, jobIDs [ ` err = GetRow(db, &getManageStatisticsResult, sql, sqlParams) getManageStatisticsResult.Date = jobTime - getManageStatisticsResult.InversionRate = float64(getManageStatisticsResult.FinishCount) / float64(getManageStatisticsResult.BrowseCount) + if getManageStatisticsResult.BrowseCount == 0 { + getManageStatisticsResult.InversionRate = 0 + } else { + getManageStatisticsResult.InversionRate = float64(getManageStatisticsResult.FinishCount) / float64(getManageStatisticsResult.BrowseCount) + } return getManageStatisticsResult, err }