This commit is contained in:
苏尹岚
2021-04-20 09:33:30 +08:00
parent 14f7fc7828
commit a75ed0f33c
18 changed files with 473 additions and 459 deletions

View File

@@ -292,20 +292,20 @@ func QueryActs(db *DaoDB, actID int, offset, pageSize int, syncStatus int, keywo
sqlParams = append(sqlParams, pageSize, offset)
var idList []int
Begin(db)
txDB, _ := Begin(db)
defer func() {
if r := recover(); r != nil {
Rollback(db)
Rollback(db, txDB)
panic(r)
}
}()
// globals.SugarLogger.Debug(sql)
if err = GetRows(db, &idList, sql, sqlParams...); err != nil || len(idList) == 0 {
Rollback(db)
if err = GetRowsTx(txDB, &idList, sql, sqlParams...); err != nil || len(idList) == 0 {
Rollback(db, txDB)
return pagedInfo, err
}
pagedInfo.TotalCount = GetLastTotalRowCount(db)
Commit(db)
pagedInfo.TotalCount = GetLastTotalRowCountTx(txDB)
Commit(db, txDB)
sql = `
SELECT