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

Method ResetDocumentNumber

models/book.go:635–643  ·  view source on GitHub ↗

重置文档数量

(bookId int)

Source from the content-addressed store, hash-verified

633
634//重置文档数量
635func (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// 内容替换
646func (m *Book) Replace(bookId int, src, dst string) {

Callers 3

CopyMethod · 0.95
DeleteMethod · 0.80
InsertOrUpdateMethod · 0.80

Calls 3

NewDocumentFunction · 0.85
CountMethod · 0.45
TableNameWithPrefixMethod · 0.45

Tested by

no test coverage detected