12345678910111213141516171819202122232425262728293031323334353637383940 |
- package cygx
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- type ArticleComment struct {
- Id int `description:"主键ID"`
- ArticleId int `description:"活动ID"`
- UserId int `description:"用户ID"`
- CreateTime string `description:"创建时间"`
- Mobile string `description:"手机号"`
- CompanyName string `description:"公司名称"`
- RealName string `description:"姓名"`
- Content string `description:"内容"`
- }
- type ArticleCommentListResp struct {
- List []*ArticleComment
- }
- // 列表
- func GetArticleCommentList(articleId int) (items []*ArticleComment, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT k.*
- FROM cygx_article_comment as k
- WHERE article_id = ? ORDER BY create_time DESC`
- _, err = o.Raw(sql, articleId).QueryRows(&items)
- return
- }
- // 留言列表
- func GetArticleCommentListSearch(condition string, pars []interface{}) (items []*ArticleComment, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := ` SELECT k.*
- FROM cygx_article_comment as k
- WHERE 1= 1 ` + condition + ` ORDER BY create_time DESC `
- _, err = o.Raw(sql, pars).QueryRows(&items)
- return
- }
|