(bookId int, cols ...string)
| 24 | } |
| 25 | |
| 26 | func (m *Document) FirstChapter(bookId int, cols ...string) (doc Document, err error) { |
| 27 | err = orm.NewOrm().QueryTable(m).Filter("book_id", bookId).OrderBy("parent_id", "order_sort", "identify").One(&doc, cols...) |
| 28 | return |
| 29 | } |
| 30 | |
| 31 | // 获取书籍的文档树状结构 |
| 32 | func (m *Document) FindDocumentTree(bookId int, selectedId int, isEdit ...bool) ([]*DocumentTree, error) { |