diff --git a/business/model/dao/dao_print.go b/business/model/dao/dao_print.go index bea5c2622..f23e13541 100644 --- a/business/model/dao/dao_print.go +++ b/business/model/dao/dao_print.go @@ -151,7 +151,6 @@ func QueryPrintList(db *DaoDB, printNo, printKey string, status, isOnline int64, sql += ` ORDER BY status desc,is_online desc LIMIT ? OFFSET ? ` sqlParams = append(sqlParams, size, page) tx, _ := Begin(db) - defer Commit(db, tx) if err = GetRowsTx(tx, &print, sql, sqlParams...); err != nil { Rollback(db, tx) return nil, 0, err @@ -159,6 +158,7 @@ func QueryPrintList(db *DaoDB, printNo, printKey string, status, isOnline int64, globals.SugarLogger.Debugf("----sql := %s", sql) globals.SugarLogger.Debugf("----sqlParams := %s", utils.Format4Output(sqlParams, false)) count = GetLastTotalRowCountTx(tx) + defer Commit(db, tx) return print, count, err }