1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 17:40:55 +00:00

change limit 1000 to 1,reduce the amount the data

This commit is contained in:
maxin[马鑫] 2016-04-11 09:02:22 +05:30
parent 88c5dfa6ea
commit 553078d956

View File

@ -192,6 +192,7 @@ func (o *querySet) All(container interface{}, cols ...string) (int64, error) {
// query one row data and map to containers. // query one row data and map to containers.
// cols means the columns when querying. // cols means the columns when querying.
func (o *querySet) One(container interface{}, cols ...string) error { func (o *querySet) One(container interface{}, cols ...string) error {
o.limit = 1
num, err := o.orm.alias.DbBaser.ReadBatch(o.orm.db, o, o.mi, o.cond, container, o.orm.alias.TZ, cols) num, err := o.orm.alias.DbBaser.ReadBatch(o.orm.db, o, o.mi, o.cond, container, o.orm.alias.TZ, cols)
if err != nil { if err != nil {
return err return err