MCPcopy Index your code
hub / github.com/TruthHun/DocHub / GetCommentList

Method GetCommentList

models/CommentModel.go:38–51  ·  view source on GitHub ↗

获取文档评论列表 @param did 文档ID @param p 页码 @param listRows 每页记录数 @return params 返回的数据 @return rows 返回的数据记录数 @return err 返回错误

(did, p, listRows int)

Source from the content-addressed store, hash-verified

36//@return rows 返回的数据记录数
37//@return err 返回错误
38func (this *DocumentComment) GetCommentList(did, p, listRows int) (params []orm.Params, rows int64, err error) {
39 tables := []string{GetTableDocumentComment() + " c", GetTableUser() + " u"}
40 on := []map[string]string{
41 {"c.Uid": "u.Id"},
42 }
43 fields := map[string][]string{
44 "c": GetFields(NewDocumentComment()),
45 "u": {"Username", "Avatar"},
46 }
47 if sql, err := LeftJoinSqlBuild(tables, on, fields, p, listRows, []string{"c.Id desc"}, nil, "c.Did=?"); err == nil {
48 rows, err = orm.NewOrm().Raw(sql, did).Values(&params)
49 }
50 return params, rows, err
51}
52
53//根据文档ID删除文档评论
54//@param ids 文档id

Callers 2

GetMethod · 0.80
GetCommentMethod · 0.80

Calls 5

GetTableDocumentCommentFunction · 0.85
GetTableUserFunction · 0.85
GetFieldsFunction · 0.85
NewDocumentCommentFunction · 0.85
LeftJoinSqlBuildFunction · 0.85

Tested by

no test coverage detected