aa
This commit is contained in:
@@ -75,13 +75,13 @@ func GetDeliveryOrders(db *DaoDB, userIDs []string, statuss []int, fromTime, toT
|
||||
sql += " LIMIT ? OFFSET ?"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
Begin(db)
|
||||
defer Commit(db)
|
||||
txDB, _ := Begin(db)
|
||||
defer Commit(db, txDB)
|
||||
fmt.Println(sql)
|
||||
fmt.Println(sqlParams)
|
||||
if err = GetRows(db, &dOrders, sql, sqlParams...); err == nil {
|
||||
if err = GetRowsTx(txDB, &dOrders, sql, sqlParams...); err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: GetLastTotalRowCount(db),
|
||||
TotalCount: GetLastTotalRowCountTx(txDB),
|
||||
// Data: dOrders,
|
||||
}
|
||||
for _, v := range dOrders {
|
||||
@@ -170,11 +170,11 @@ func GetOrders(db *DaoDB, orderID, userID string, orderType int, cityCodes []int
|
||||
sql += " LIMIT ? OFFSET ?"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
Begin(db)
|
||||
defer Commit(db)
|
||||
if err = GetRows(db, &orders, sql, sqlParams); err == nil {
|
||||
txDB, _ := Begin(db)
|
||||
defer Commit(db, txDB)
|
||||
if err = GetRowsTx(txDB, &orders, sql, sqlParams); err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: GetLastTotalRowCount(db),
|
||||
TotalCount: GetLastTotalRowCountTx(txDB),
|
||||
Data: orders,
|
||||
}
|
||||
}
|
||||
@@ -506,13 +506,13 @@ func GetManageStatisticsJob(db *DaoDB, cityCodes []int, fromTime, toTime time.Ti
|
||||
sql += " LIMIT ? OFFSET ?"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
Begin(db)
|
||||
defer Commit(db)
|
||||
err = GetRows(db, &getManageStatisticsJobResult, sql, sqlParams)
|
||||
txDB, _ := Begin(db)
|
||||
defer Commit(db, txDB)
|
||||
err = GetRowsTx(txDB, &getManageStatisticsJobResult, sql, sqlParams)
|
||||
if err == nil {
|
||||
pageInfo = &model.PagedInfo{
|
||||
Data: getManageStatisticsJobResult,
|
||||
TotalCount: GetLastTotalRowCount(db),
|
||||
TotalCount: GetLastTotalRowCountTx(txDB),
|
||||
}
|
||||
}
|
||||
return pageInfo, err
|
||||
|
||||
Reference in New Issue
Block a user