浏览代码

y研选作者模块取消发布的文章不展示

xingzai 2 年之前
父节点
当前提交
8e23d3ba75
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      models/article.go
  2. 1 1
      models/report.go

+ 1 - 1
models/article.go

@@ -157,7 +157,7 @@ type SellerRep struct {
 
 func GetArticleDetailById(articleId int) (item *ArticleDetail, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_article WHERE article_id = ? `
+	sql := `SELECT * FROM cygx_article WHERE article_id = ?  AND publish_status = 1  `
 	err = o.Raw(sql, articleId).QueryRow(&item)
 	return
 }

+ 1 - 1
models/report.go

@@ -351,7 +351,7 @@ func GetArticleCollectionList(condition string, userId int) (items []*ArticleCol
 			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id
 			INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id 
 		WHERE
-			1 = 1 `
+			1 = 1  AND a.publish_status = 1  `
 	if condition != "" {
 		sql += condition
 	}