ziwen 1 سال پیش
والد
کامیت
81f61a7b8e
2فایلهای تغییر یافته به همراه15 افزوده شده و 9 حذف شده
  1. 6 4
      controllers/cygx/yanxuan_special.go
  2. 9 5
      models/cygx/cygx_yanxuan_special.go

+ 6 - 4
controllers/cygx/yanxuan_special.go

@@ -125,8 +125,8 @@ func (this *YanxuanSpecialController) AuthorEnable() {
 	br.Success = true
 }
 
-// @Title 禁用/启用研选专栏作者
-// @Description 禁用/启用研选专栏作者
+// @Title 作者列表
+// @Description 作者列表
 // @Param	request	body help_doc.AddHelpDocReq true "type json string"
 // @Success 200 {object} models.AddEnglishReportResp
 // @router /yanxuan_special/author/list [get]
@@ -157,8 +157,8 @@ func (this *YanxuanSpecialController) AuthorList() {
 	br.Msg = "获取成功"
 }
 
-// @Title 禁用/启用研选专栏作者
-// @Description 禁用/启用研选专栏作者
+// @Title 审核列表
+// @Description 审核列表
 // @Param	request	body help_doc.AddHelpDocReq true "type json string"
 // @Success 200 {object} models.AddEnglishReportResp
 // @router /yanxuan_special/list [get]
@@ -185,6 +185,8 @@ func (this *YanxuanSpecialController) List() {
 		pars = append(pars, userId)
 	}
 
+	condition += ` AND a.status = 2 `
+
 	list, tmpErr := cygx.GetYanxuanSpecialList(condition, pars)
 	if tmpErr != nil {
 		br.Msg = "获取失败"

+ 9 - 5
models/cygx/cygx_yanxuan_special.go

@@ -13,10 +13,12 @@ type CygxYanxuanSpecial struct {
 	PublishTime time.Time // 提审过审或驳回时间
 	Content     string    // 内容
 	Tags        string    // 标签
-	Status      int       // 1:未发布,2:已发布 3:过审 4:驳回
+	Status      int       // 1:未发布,2:审核中 3:已发布 4:驳回
 	ImgUrl      string    // 图片链接
 	DocUrl      string    // 文档链接
 	Reason      string    // 理由
+	Title       string    // 标题
+	Type        string    // 类型1:笔记,2:观点
 }
 
 type CygxYanxuanSpecialItem struct {
@@ -27,7 +29,7 @@ type CygxYanxuanSpecialItem struct {
 	PublishTime  string // 提审过审或驳回时间
 	Content      string // 内容
 	Tags         string // 标签
-	Status       int    // 1:未发布,2:已发布 3:过审 4:驳回
+	Status       int    // 1:未发布,2:审核中 3:已发布 4:驳回
 	ImgUrl       string // 图片链接
 	DocUrl       string // 文档链接
 	SpecialName  string // 专栏名称
@@ -39,6 +41,8 @@ type CygxYanxuanSpecialItem struct {
 	HeadImg      string // 头像
 	BgImg        string // 背景图
 	Reason       string // 理由
+	Title        string // 标题
+	Type         int // 类型1:笔记,2:观点
 }
 
 func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpecialItem, err error) {
@@ -52,7 +56,7 @@ JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
 		sql += condition
 	}
 	sql += `ORDER BY a.create_time `
-	_, err = o.Raw(sql).QueryRows(&items)
+	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
 }
 
@@ -62,10 +66,10 @@ type EnableCygxYanxuanSpecialReq struct {
 	Reason string //理由
 }
 
-func EnableYanxuanSpecial(id, status int,reason string) (err error) {
+func EnableYanxuanSpecial(id, status int, reason string) (err error) {
 	o := orm.NewOrm()
 	sql := ``
 	sql = `UPDATE cygx_yanxuan_special SET status=?,reason=?,publish_time=NOW() WHERE id = ? `
 	_, err = o.Raw(sql, status, reason, id).Exec()
 	return
-}
+}