This commit is contained in:
苏尹岚
2021-01-04 18:16:30 +08:00
parent 78bb668fad
commit 007fdd7342
6 changed files with 255 additions and 1 deletions

View File

@@ -158,3 +158,24 @@ func GetPayStatistics(ctx *jxcontext.Context, userID string, pop int, cityCodes
)
return dao.GetPayStatistics(db, userID, pop, cityCodes, mobile, utils.Str2Time(fromTime), utils.Str2Time(toTime), consumeTypes)
}
func GetManageStatisticsImg(ctx *jxcontext.Context, cityCodes []int, fromTime, toTime string, jobIDs []int) (getManageStatistics []*dao.GetManageStatisticsResult, err error) {
var (
db = dao.GetDB()
fromTimeT = utils.Str2Time(fromTime)
toTimeT = utils.Str2Time(toTime)
)
for i := 1; i < utils.Float64TwoInt(toTimeT.Sub(fromTimeT).Hours()/24); i++ {
if getManageStatisticsResult, err := dao.GetManageStatistics(db, cityCodes, fromTimeT.AddDate(0, 0, i), jobIDs); err == nil {
getManageStatistics = append(getManageStatistics, getManageStatisticsResult)
}
}
return getManageStatistics, err
}
func GetManageStatisticsJob(ctx *jxcontext.Context, cityCodes []int, fromTime, toTime string, jobIDs []int, offset, pageSize int) (paged *model.PagedInfo, err error) {
var (
db = dao.GetDB()
)
return dao.GetManageStatisticsJob(db, cityCodes, utils.Str2Time(fromTime), utils.Str2Time(toTime), jobIDs, offset, pageSize)
}