diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index dc5f27206..18c1eef62 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -1,7 +1,6 @@ package dao import ( - "math" "time" "git.rosy.net.cn/baseapi/utils" @@ -451,14 +450,18 @@ func GetManageStatistics(db *DaoDB, cityCodes []int, jobTime time.Time, jobIDs [ WHERE a.id = t5.id )t6 ` - err = GetRow(db, &getManageStatisticsResult, sql, sqlParams) + GetRow(db, &getManageStatisticsResult, sql, sqlParams) if getManageStatisticsResult == nil { return &GetManageStatisticsResult{ Date: jobTime, }, err } else { getManageStatisticsResult.Date = jobTime - getManageStatisticsResult.InversionRate = math.Round(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 } }