MCPcopy Create free account
hub / github.com/TruthHun/BookStack / GetByBookId

Method GetByBookId

models/book_category.go:24–29  ·  view source on GitHub ↗

根据书籍id查询分类id

(book_id int)

Source from the content-addressed store, hash-verified

22
23//根据书籍id查询分类id
24func (this *BookCategory) GetByBookId(book_id int) (cates []Category, rows int64, err error) {
25 o := orm.NewOrm()
26 sql := "select c.* from md_category c left join md_book_category bc on c.id=bc.category_id where bc.book_id=?"
27 rows, err = o.Raw(sql, book_id).QueryRows(&cates)
28 return
29}
30
31//处理书籍分类
32func (this *BookCategory) SetBookCates(bookId int, cids []string) {

Callers 1

SettingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected