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

Method Sorted

models/book.go:139–144  ·  view source on GitHub ↗
(limit int, orderField string)

Source from the content-addressed store, hash-verified

137}
138
139func (m *Book) Sorted(limit int, orderField string) (books []Book) {
140 o := orm.NewOrm()
141 fields := []string{"book_id", "book_name", "identify", "cover", "vcnt", "star", "cnt_comment"}
142 o.QueryTable(m).Filter("order_index__gte", 0).Filter("privately_owned", 0).OrderBy("-"+orderField).Limit(limit).All(&books, fields...)
143 return
144}
145
146func (m *Book) Insert() (err error) {
147 o := orm.NewOrm()

Callers 2

IndexMethod · 0.95
RankMethod · 0.95

Calls 1

AllMethod · 0.45

Tested by

no test coverage detected