diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index f45b62125..cd9868a9d 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -1,6 +1,7 @@ package dao import ( + "math" "time" "git.rosy.net.cn/baseapi/utils" @@ -408,7 +409,9 @@ func getWhereSqlManage(cityCodes []int, jobTime, endTime time.Time, jobIDs []int func GetManageStatistics(db *DaoDB, cityCodes []int, jobTime time.Time, jobIDs []int) (getManageStatisticsResult *GetManageStatisticsResult, err error) { endTime := jobTime.AddDate(0, 0, 1) sqlParams := []interface{}{} - getManageStatisticsResult = &GetManageStatisticsResult{} + getManageStatisticsResult = &GetManageStatisticsResult{ + Date: jobTime, + } sql := ` SELECT t1.count accept_count, t2.count finish_count, t3.count cancel_count, t4.browse_count, t6.total_cash FROM @@ -452,11 +455,10 @@ func GetManageStatistics(db *DaoDB, cityCodes []int, jobTime time.Time, jobIDs [ )t6 ` err = GetRow(db, &getManageStatisticsResult, sql, sqlParams) - getManageStatisticsResult.Date = jobTime if getManageStatisticsResult.BrowseCount == 0 { getManageStatisticsResult.InversionRate = 0 } else { - getManageStatisticsResult.InversionRate = float64(getManageStatisticsResult.FinishCount) / float64(getManageStatisticsResult.BrowseCount) + getManageStatisticsResult.InversionRate = math.Round(float64(getManageStatisticsResult.FinishCount) / float64(getManageStatisticsResult.BrowseCount)) } return getManageStatisticsResult, err }