mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 10:01:28 +00:00
reduce the data transmission
This commit is contained in:
parent
553078d956
commit
9679f5e22a
@ -192,7 +192,9 @@ 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
|
if o.limit != 1 {
|
||||||
|
o.limit = 2
|
||||||
|
}
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user