mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-12-19 19:57:09 +08:00
1、实现富文本编辑器
2、实现文档转换为PDF、MOBI、EPUB、Word格式 3、实现登录后跳转到来源地址
This commit is contained in:
@@ -4,11 +4,11 @@ import "github.com/astaxie/beego/orm"
|
||||
|
||||
type CommentResult struct {
|
||||
Comment
|
||||
Author string `json:"author"`
|
||||
ReplyAccount string `json:"reply_account"`
|
||||
Author string `json:"author"`
|
||||
ReplyAccount string `json:"reply_account"`
|
||||
}
|
||||
|
||||
func (m *CommentResult) FindForDocumentToPager(doc_id, page_index,page_size int) (comments []*CommentResult,totalCount int,err error) {
|
||||
func (m *CommentResult) FindForDocumentToPager(doc_id, page_index, page_size int) (comments []*CommentResult, totalCount int, err error) {
|
||||
|
||||
o := orm.NewOrm()
|
||||
|
||||
@@ -25,12 +25,11 @@ FROM md_comments AS comment
|
||||
|
||||
WHERE comment.document_id = ? ORDER BY comment.comment_id DESC LIMIT 0,10`
|
||||
|
||||
|
||||
offset := (page_index - 1) * page_size
|
||||
|
||||
_,err = o.Raw(sql1,doc_id,offset, page_size).QueryRows(&comments)
|
||||
_, err = o.Raw(sql1, doc_id, offset, page_size).QueryRows(&comments)
|
||||
|
||||
v,err := o.QueryTable(m.TableNameWithPrefix()).Filter("document_id",doc_id).Count()
|
||||
v, err := o.QueryTable(m.TableNameWithPrefix()).Filter("document_id", doc_id).Count()
|
||||
|
||||
if err == nil {
|
||||
totalCount = int(v)
|
||||
@@ -38,4 +37,3 @@ WHERE comment.document_id = ? ORDER BY comment.comment_id DESC LIMIT 0,10`
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user