aa
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"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
|
WHERE a.id = t5.id
|
||||||
)t6
|
)t6
|
||||||
`
|
`
|
||||||
err = GetRow(db, &getManageStatisticsResult, sql, sqlParams)
|
GetRow(db, &getManageStatisticsResult, sql, sqlParams)
|
||||||
if getManageStatisticsResult == nil {
|
if getManageStatisticsResult == nil {
|
||||||
return &GetManageStatisticsResult{
|
return &GetManageStatisticsResult{
|
||||||
Date: jobTime,
|
Date: jobTime,
|
||||||
}, err
|
}, err
|
||||||
} else {
|
} else {
|
||||||
getManageStatisticsResult.Date = jobTime
|
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
|
return getManageStatisticsResult, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user