- dao.GetLastTotalRowCount
This commit is contained in:
@@ -220,10 +220,7 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
if err = dao.GetRows(db, &retVal.Stores, sql, sqlParams...); err == nil {
|
||||
countInfo := &struct{ Ct int }{}
|
||||
if err = dao.GetRow(db, countInfo, "SELECT FOUND_ROWS() ct"); err == nil {
|
||||
retVal.TotalCount = countInfo.Ct
|
||||
}
|
||||
retVal.TotalCount = dao.GetLastTotalRowCount(db)
|
||||
for _, v := range retVal.Stores {
|
||||
if v.StoreMapStr != "" {
|
||||
if err = utils.UnmarshalUseNumber([]byte(v.StoreMapStr), &v.StoreMaps); err != nil {
|
||||
@@ -498,14 +495,11 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeID, page, size, c
|
||||
}()
|
||||
globals.SugarLogger.Debug(sql)
|
||||
if err = dao.GetRows(db, &commentList, sql, utils.Int2Str(storeID), size, (page-1)*size); err == nil {
|
||||
countInfo := &struct{ Ct int }{}
|
||||
if err = dao.GetRow(db, countInfo, "SELECT FOUND_ROWS() ct"); err == nil {
|
||||
dao.Commit(db)
|
||||
retVal = map[string]interface{}{
|
||||
"total": countInfo.Ct,
|
||||
"list": commentList,
|
||||
}
|
||||
retVal = map[string]interface{}{
|
||||
"total": dao.GetLastTotalRowCount(db),
|
||||
"list": commentList,
|
||||
}
|
||||
dao.Commit(db)
|
||||
}
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user