|
@@ -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)
|