重置文档数量
(bookId int)
| 633 | |
| 634 | //重置文档数量 |
| 635 | func (m *Book) ResetDocumentNumber(bookId int) { |
| 636 | o := orm.NewOrm() |
| 637 | totalCount, err := o.QueryTable(NewDocument().TableNameWithPrefix()).Filter("book_id", bookId).Count() |
| 638 | if err == nil { |
| 639 | o.Raw("UPDATE md_books SET doc_count = ? WHERE book_id = ?", int(totalCount), bookId).Exec() |
| 640 | } else { |
| 641 | beego.Error(err) |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | // 内容替换 |
| 646 | func (m *Book) Replace(bookId int, src, dst string) { |
no test coverage detected