cygx_yanxuan_special_approval_log.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "github.com/rdlucklib/rdluck_tools/paging"
  5. )
  6. type CygxYanxuanSpecialApprovalLogResp struct {
  7. ApprovalLogId int `orm:"column(approval_log_id);pk"`
  8. UserId int // 用户ID
  9. CreateTime string // 创建时间
  10. ModifyTime string // 修改时间
  11. Content string // 内容
  12. Tags string // 标签
  13. ApprovalStatus int // 1通过、2驳回
  14. ImgUrl string // 图片链接
  15. DocUrl string // 文档链接
  16. Reason string // 理由
  17. Title string // 标题
  18. Type int // 类型1:笔记,2:观点
  19. CompanyTags string // 公司标签
  20. IndustryTags string // 行业标签
  21. YanxuanSpecialId int // cygx_yanxuan_special 表主键ID
  22. AdminName string // 审核人员姓名
  23. AdminUserId int // 审核人员用户ID
  24. SpecialName string // 专栏名称
  25. NickName string // 昵称
  26. SpecialAuthorId int //cygx_yanxuan_special_author 表主键ID 作者专栏ID
  27. }
  28. // 获取数量
  29. func GetCygxYanxuanSpecialApprovalLogCount(condition string, pars []interface{}) (count int, err error) {
  30. o := orm.NewOrmUsingDB("hz_cygx")
  31. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_yanxuan_special_approval_log as a WHERE 1= 1 `
  32. if condition != "" {
  33. sqlCount += condition
  34. }
  35. err = o.Raw(sqlCount, pars).QueryRow(&count)
  36. return
  37. }
  38. func GetCygxYanxuanSpecialApprovalLogList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxYanxuanSpecialApprovalLogResp, err error) {
  39. o := orm.NewOrmUsingDB("hz_cygx")
  40. sql := ``
  41. sql = `SELECT * FROM cygx_yanxuan_special_approval_log AS a WHERE 1=1 `
  42. if condition != "" {
  43. sql += condition
  44. }
  45. sql += ` LIMIT ?,? `
  46. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  47. return
  48. }
  49. type CygxYanxuanSpecialApprovalLogListResp struct {
  50. Paging *paging.PagingItem `description:"分页数据"`
  51. List []*CygxYanxuanSpecialApprovalLogResp
  52. }