根据书籍ID查询文档列表(含文档内容).
(bookId int, withoutContent ...bool)
| 556 | |
| 557 | //根据书籍ID查询文档列表(含文档内容). |
| 558 | func (m *Document) FindListByBookId(bookId int, withoutContent ...bool) (docs []*Document, err error) { |
| 559 | q := orm.NewOrm().QueryTable(m.TableNameWithPrefix()).Filter("book_id", bookId).OrderBy("order_sort") |
| 560 | if len(withoutContent) > 0 && withoutContent[0] { |
| 561 | cols := []string{"document_id", "identify", "document_name", "book_id", "vcnt", "version", |
| 562 | "modify_time", "member_id", "create_time", "order_sort", "parent_id"} |
| 563 | _, err = q.All(&docs, cols...) |
| 564 | } else { |
| 565 | _, err = q.All(&docs) |
| 566 | } |
| 567 | return |
| 568 | } |
| 569 | |
| 570 | //根据书籍ID查询文档一级目录. |
| 571 | func (m *Document) GetMenuTop(bookId int) (docs []*Document, err error) { |
no test coverage detected