- dao.GetLastTotalRowCount

This commit is contained in:
gazebo
2018-12-21 11:07:18 +08:00
parent acb073cb92
commit c7577e6005
5 changed files with 26 additions and 40 deletions

View File

@@ -628,12 +628,10 @@ func GetJdPromotions(ctx *jxcontext.Context, keyword string, params map[string]i
}
}
}
pagedInfo = &model.PagedInfo{}
countInfo := &struct{ Ct int }{}
if err = dao.GetRow(db, countInfo, "SELECT FOUND_ROWS() ct"); err == nil {
pagedInfo.TotalCount = countInfo.Ct
pagedInfo = &model.PagedInfo{
TotalCount: dao.GetLastTotalRowCount(db),
Data: promotionList,
}
pagedInfo.Data = promotionList
}
dao.Commit(db)
return pagedInfo, err