!18 限制下查询单条记录查询条数

Merge pull request !18 from 一墨染尽青衣颜/master
This commit is contained in:
一墨染尽青衣颜 2019-04-04 22:55:13 +08:00 committed by John
parent aa4dca11f0
commit 6863928b06

View File

@ -456,6 +456,7 @@ func (md *Model) All() (Result, error) {
// 链式操作,查询单条记录
func (md *Model) One() (Record, error) {
md.limit = 1
list, err := md.All()
if err != nil {
return nil, err