(cols ...string)
| 190 | } |
| 191 | |
| 192 | func (m *Book) Update(cols ...string) (err error) { |
| 193 | o := orm.NewOrm() |
| 194 | |
| 195 | temp := NewBook() |
| 196 | temp.BookId = m.BookId |
| 197 | |
| 198 | if err = o.Read(temp); err != nil { |
| 199 | return err |
| 200 | } |
| 201 | |
| 202 | if (m.Label + temp.Label) != "" { |
| 203 | go NewLabel().InsertOrUpdateMulti(m.Label + "," + temp.Label) |
| 204 | } |
| 205 | |
| 206 | _, err = o.Update(m, cols...) |
| 207 | return err |
| 208 | } |
| 209 | |
| 210 | //根据指定字段查询结果集. |
| 211 | func (m *Book) FindByField(field string, value interface{}) (books []*Book, err error) { |
no test coverage detected