MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Update

Method Update

models/book.go:192–208  ·  view source on GitHub ↗
(cols ...string)

Source from the content-addressed store, hash-verified

190}
191
192func (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//根据指定字段查询结果集.
211func (m *Book) FindByField(field string, value interface{}) (books []*Book, err error) {

Callers 15

CreateTokenMethod · 0.95
loginByMemberIdMethod · 0.45
sortBySummaryMethod · 0.45
LoginMethod · 0.45
ValidEmailMethod · 0.45
RenderMarkdownMethod · 0.45
IndexMethod · 0.45
PasswordMethod · 0.45
QrcodeMethod · 0.45
UploadMethod · 0.45
SaveBookMethod · 0.45
PrivatelyOwnedMethod · 0.45

Calls 4

NewBookFunction · 0.85
NewLabelFunction · 0.85
InsertOrUpdateMultiMethod · 0.80
ReadMethod · 0.45

Tested by

no test coverage detected