|
@@ -22,22 +22,23 @@ type CygxYanxuanSpecialAuthor struct {
|
|
}
|
|
}
|
|
|
|
|
|
type CygxYanxuanSpecialAuthorItem struct {
|
|
type CygxYanxuanSpecialAuthorItem struct {
|
|
- Id int `orm:"column(id);pk"`
|
|
+ Id int `orm:"column(id);pk"`
|
|
- UserId int
|
|
+ UserId int
|
|
- SpecialName string
|
|
+ SpecialName string
|
|
- Introduction string
|
|
+ Introduction string
|
|
- Label string
|
|
+ Label string
|
|
- NickName string
|
|
+ NickName string
|
|
- RealName string
|
|
+ RealName string
|
|
- CompanyName string
|
|
+ CompanyName string
|
|
- Mobile string
|
|
+ Mobile string
|
|
- CreateTime string
|
|
+ CreateTime string
|
|
- ModifyTime string
|
|
+ ModifyTime string
|
|
- HeadImg string
|
|
+ HeadImg string
|
|
- BgImg string
|
|
+ BgImg string
|
|
- Status int
|
|
+ Status int
|
|
- CollectNum int
|
|
+ CollectNum int
|
|
- FollowNum 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
|
|
+ UserId int
|
|
- SpecialName string
|
|
+ SpecialName string
|
|
- Introduction string
|
|
+ Introduction string
|
|
- Label string
|
|
+ Label string
|
|
- NickName string
|
|
+ NickName string
|
|
- BgImg string
|
|
+ BgImg string
|
|
}
|
|
}
|
|
|
|
|
|
func UpdateYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (err error) {
|
|
func UpdateYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (err error) {
|