article_ask.go 795 B

123456789101112131415161718192021222324252627282930
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type ArticleAsk struct {
  6. AskId int `description:"主键ID"`
  7. ArticleId int `description:"活动ID"`
  8. UserId int `description:"用户ID"`
  9. CreateTime string `description:"创建时间"`
  10. Mobile string `description:"手机号"`
  11. CompanyName string `description:"公司名称"`
  12. RealName string `description:"姓名"`
  13. Content string `description:"内容"`
  14. }
  15. type ArticleAskListResp struct {
  16. List []*ArticleAsk
  17. }
  18. // 列表
  19. func GetArticleAskList(articleId int) (items []*ArticleAsk, err error) {
  20. o := orm.NewOrmUsingDB("hz_cygx")
  21. sql := `SELECT k.*
  22. FROM cygx_article_ask as k
  23. WHERE article_id = ? ORDER BY create_time DESC`
  24. _, err = o.Raw(sql, articleId).QueryRows(&items)
  25. return
  26. }