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