|
@@ -22,22 +22,23 @@ type CygxYanxuanSpecialAuthor struct {
|
|
}
|
|
}
|
|
|
|
|
|
type CygxYanxuanSpecialAuthorItem struct {
|
|
type CygxYanxuanSpecialAuthorItem struct {
|
|
- Id int `orm:"column(id);pk"`
|
|
|
|
- UserId int // 用户ID
|
|
|
|
- SpecialName string // 专栏名称
|
|
|
|
- Introduction string // 介绍
|
|
|
|
- Label string // 标签
|
|
|
|
- NickName string // 昵称
|
|
|
|
- RealName string // 姓名
|
|
|
|
- CompanyName string // 公司名
|
|
|
|
- Mobile string // 手机号
|
|
|
|
- CreateTime string // 创建时间
|
|
|
|
- ModifyTime string // 修改时间
|
|
|
|
- HeadImg string // 头像
|
|
|
|
- BgImg string // 背景图
|
|
|
|
- Status int // 1启用2禁用
|
|
|
|
- CollectNum int // 被收藏数
|
|
|
|
- FollowNum int // 被关注数
|
|
|
|
|
|
+ Id int `orm:"column(id);pk"`
|
|
|
|
+ UserId int // 用户ID
|
|
|
|
+ SpecialName string // 专栏名称
|
|
|
|
+ Introduction string // 介绍
|
|
|
|
+ Label string // 标签
|
|
|
|
+ NickName string // 昵称
|
|
|
|
+ RealName string // 姓名
|
|
|
|
+ CompanyName string // 公司名
|
|
|
|
+ Mobile string // 手机号
|
|
|
|
+ CreateTime string // 创建时间
|
|
|
|
+ ModifyTime string // 修改时间
|
|
|
|
+ HeadImg string // 头像
|
|
|
|
+ BgImg string // 背景图
|
|
|
|
+ Status int // 1启用2禁用
|
|
|
|
+ CollectNum int // 被收藏数
|
|
|
|
+ FollowNum int // 被关注数
|
|
|
|
+ SpecialArticleNum int // 文章数
|
|
}
|
|
}
|
|
|
|
|
|
func AddCygxYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (lastId int64, err error) {
|
|
func AddCygxYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (lastId int64, err error) {
|
|
@@ -66,7 +67,8 @@ func GetYanxuanSpecialAuthor(userId int) (item *CygxYanxuanSpecialAuthorItem, er
|
|
sql = `SELECT
|
|
sql = `SELECT
|
|
a.*,c.company_name,
|
|
a.*,c.company_name,
|
|
( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac INNER JOIN cygx_yanxuan_special as cs ON ac.yanxuan_special_id = cs.id WHERE cs.user_id = a.user_id ) AS collect_num,
|
|
( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac INNER JOIN cygx_yanxuan_special as cs ON ac.yanxuan_special_id = cs.id WHERE cs.user_id = a.user_id ) AS collect_num,
|
|
- ( SELECT count( 1 ) FROM cygx_yanxuan_special_follow AS cf WHERE cf.follow_user_id = a.user_id ) AS follow_num
|
|
|
|
|
|
+ ( SELECT count( 1 ) FROM cygx_yanxuan_special_follow AS cf WHERE cf.follow_user_id = a.user_id ) AS follow_num,
|
|
|
|
+ ( SELECT count( 1 ) FROM cygx_yanxuan_special AS ca WHERE ca.user_id = a.user_id ) AS special_article_num
|
|
FROM
|
|
FROM
|
|
cygx_yanxuan_special_author as a
|
|
cygx_yanxuan_special_author as a
|
|
INNER JOIN wx_user AS u ON u.user_id = a.user_id
|
|
INNER JOIN wx_user AS u ON u.user_id = a.user_id
|
|
@@ -76,12 +78,12 @@ FROM
|
|
}
|
|
}
|
|
|
|
|
|
type SaveCygxYanxuanSpecialAuthorReq struct {
|
|
type SaveCygxYanxuanSpecialAuthorReq struct {
|
|
- UserId int // 用户ID
|
|
|
|
- SpecialName string // 专栏名称
|
|
|
|
- Introduction string // 介绍
|
|
|
|
- Label string // 标签
|
|
|
|
- NickName string // 昵称
|
|
|
|
- BgImg string // 背景图
|
|
|
|
|
|
+ UserId int // 用户ID
|
|
|
|
+ SpecialName string // 专栏名称
|
|
|
|
+ Introduction string // 介绍
|
|
|
|
+ Label string // 标签
|
|
|
|
+ NickName string // 昵称
|
|
|
|
+ BgImg string // 背景图
|
|
}
|
|
}
|
|
|
|
|
|
func UpdateYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (err error) {
|
|
func UpdateYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (err error) {
|