ziwen 1 жил өмнө
parent
commit
d9c0a4dcea

+ 0 - 6
controllers/yanxuan_special.go

@@ -117,9 +117,6 @@ func (this *YanxuanSpecialNoLoginController) List() {
 
 	if specialUser != nil {
 		resp.IsAuthor = true
-		if specialUser.Status == 2 {
-			resp.IsDisable = true
-		}
 	}
 	resp.List = list
 
@@ -921,9 +918,6 @@ func (this *YanxuanSpecialNoLoginController) AuthorList() {
 
 	if specialUser != nil {
 		resp.IsAuthor = true
-		if specialUser.Status == 2 {
-			resp.IsDisable = true
-		}
 	}
 
 	br.Data = resp

+ 4 - 4
models/cygx_yanxuan_special.go

@@ -46,6 +46,7 @@ type CygxYanxuanSpecialItem struct {
 	BgImg           string   // 背景图
 	Reason          string   // 理由
 	Title           string   // 标题
+	AuthorStatus    int      // 作者状态
 	Type            int      // 类型1:笔记,2:观点
 	CollectNum      int
 	MyCollectNum    int
@@ -79,7 +80,7 @@ type DocReq struct {
 func GetYanxuanSpecialList(userId int, condition string, pars []interface{}) (items []*CygxYanxuanSpecialItem, err error) {
 	o := orm.NewOrm()
 	sql := ``
-	sql = `SELECT a.*,b.id AS special_column_id,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,b.nick_name,b.real_name,b.special_name,
+	sql = `SELECT a.*,b.id AS special_column_id,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,b.nick_name,b.real_name,b.special_name,b.status AS author_status,
 ( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac INNER JOIN wx_user as u ON  u.user_id = ac.user_id  WHERE ac.yanxuan_special_id = a.id  ) AS collect_num,
 ( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id  AND user_id = ? ) AS my_collect_num 
 FROM cygx_yanxuan_special AS a
@@ -108,9 +109,8 @@ func EnableYanxuanSpecial(id, status int, reason string) (err error) {
 }
 
 type SpecialListResp struct {
-	List      []*CygxYanxuanSpecialItem
-	IsAuthor  bool
-	IsDisable bool
+	List     []*CygxYanxuanSpecialItem
+	IsAuthor bool
 }
 
 func GetYanxuanSpecialById(specialId, userId int) (item *CygxYanxuanSpecialItem, err error) {

+ 0 - 1
models/cygx_yanxuan_special_user.go

@@ -141,7 +141,6 @@ ORDER BY
 type SpecialAuthorListResp struct {
 	List     []*CygxYanxuanSpecialAuthorItem
 	IsAuthor bool
-	IsDisable bool
 }
 
 type SaveCygxYanxuanSpecialAuthoHeadImgrReq struct {