wangkaiyue 6 жил өмнө
parent
commit
9eedcaf80c

+ 2 - 3
common/src/qfw/util/mysql/mysql.go

@@ -235,9 +235,8 @@ func (m *Mysql) QueryCount(query string, args ...interface{}) (count int) {
 		log.Println(err)
 		return
 	}
-	if err != nil {
-		log.Println(err)
-		return
+	if rows != nil {
+		defer rows.Close()
 	}
 	if rows.Next() {
 		err = rows.Scan(&count)