根据指定字段查询一个结果.
(field string, value interface{})
| 216 | |
| 217 | //根据指定字段查询一个结果. |
| 218 | func (m *Book) FindByFieldFirst(field string, value interface{}) (book *Book, err error) { |
| 219 | o := orm.NewOrm() |
| 220 | err = o.QueryTable(m.TableNameWithPrefix()).Filter(field, value).One(m) |
| 221 | return m, err |
| 222 | } |
| 223 | |
| 224 | func (m *Book) FindByIdentify(identify string, cols ...string) (book *Book, err error) { |
| 225 | o := orm.NewOrm() |
no test coverage detected