瀏覽代碼

Merge branch 'cygx/cygx_12.8' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

xingzai 1 年之前
父節點
當前提交
e2b52273b7
共有 1 個文件被更改,包括 51 次插入0 次删除
  1. 51 0
      models/cygx/cygx_yanxuan_special_approval_log.go

+ 51 - 0
models/cygx/cygx_yanxuan_special_approval_log.go

@@ -2,6 +2,7 @@ package cygx
 
 import (
 	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )
 
@@ -27,6 +28,56 @@ type CygxYanxuanSpecialApprovalLog struct {
 	NickName         string    // 昵称
 }
 
+type CygxYanxuanSpecialApprovalLogResp struct {
+	ApprovalLogId    int    `orm:"column(approval_log_id);pk"`
+	UserId           int    // 用户ID
+	CreateTime       string // 创建时间
+	ModifyTime       string // 修改时间
+	Content          string // 内容
+	Tags             string // 标签
+	ApprovalStatus   int    // 1通过、2驳回
+	ImgUrl           string // 图片链接
+	DocUrl           string // 文档链接
+	Reason           string // 理由
+	Title            string // 标题
+	Type             int    // 类型1:笔记,2:观点
+	CompanyTags      string // 公司标签
+	IndustryTags     string // 行业标签
+	YanxuanSpecialId int    // cygx_yanxuan_special 表主键ID
+	AdminName        string // 审核人员姓名
+	AdminUserId      int    // 审核人员用户ID
+	SpecialName      string // 专栏名称
+	NickName         string // 昵称
+}
+
+// 获取数量
+func GetCygxYanxuanSpecialApprovalLogCount(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_yanxuan_special_approval_log as a WHERE 1= 1  `
+	if condition != "" {
+		sqlCount += condition
+	}
+	err = o.Raw(sqlCount, pars).QueryRow(&count)
+	return
+}
+
+func GetCygxYanxuanSpecialApprovalLogList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxYanxuanSpecialApprovalLogResp, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sql := ``
+	sql = `SELECT * FROM cygx_yanxuan_special_approval_log AS a WHERE 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` LIMIT ?,? `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+type CygxYanxuanSpecialApprovalLogListResp struct {
+	Paging *paging.PagingItem `description:"分页数据"`
+	List   []*CygxYanxuanSpecialApprovalLogResp
+}
+
 func AddCygxYanxuanSpecialApprovalLog(item *CygxYanxuanSpecialApprovalLog) (err error) {
 	o := orm.NewOrm()
 	_, err = o.Insert(item)