ziwen 1 tahun lalu
induk
melakukan
7567fa5190
1 mengubah file dengan 18 tambahan dan 13 penghapusan
  1. 18 13
      models/cygx/cygx_yanxuan_special_user.go

+ 18 - 13
models/cygx/cygx_yanxuan_special_user.go

@@ -22,19 +22,20 @@ type CygxYanxuanSpecialAuthor struct {
 }
 
 type CygxYanxuanSpecialAuthorItem struct {
-	Id           int       `orm:"column(id);pk"`
-	UserId       int       // 用户ID
-	SpecialName  string    // 专栏名称
-	Introduction string    // 介绍
-	Label        string    // 标签
-	NickName     string    // 昵称
-	RealName     string    // 姓名
-	Mobile       string    // 手机号
+	Id           int    `orm:"column(id);pk"`
+	UserId       int    // 用户ID
+	CompanyName  string // 公司名
+	SpecialName  string // 专栏名称
+	Introduction string // 介绍
+	Label        string // 标签
+	NickName     string // 昵称
+	RealName     string // 姓名
+	Mobile       string // 手机号
 	CreateTime   string // 创建时间
 	ModifyTime   string // 修改时间
-	HeadImg      string    // 头像
-	BgImg        string    // 背景图
-	Status       int       // 1启用2禁用
+	HeadImg      string // 头像
+	BgImg        string // 背景图
+	Status       int    // 1启用2禁用
 }
 
 func AddCygxYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (lastId int64, err error) {
@@ -66,8 +67,12 @@ func EnableYanxuanSpecialAuthor(userId, status int) (err error) {
 func GetYanxuanSpecialAuthorList() (items []*CygxYanxuanSpecialAuthorItem, err error) {
 	o := orm.NewOrm()
 	sql := ``
-	sql = `SELECT * FROM cygx_yanxuan_special_author ORDER BY create_time DESC `
+	sql = `SELECT
+	a.*,c.company_name  
+FROM
+	cygx_yanxuan_special_author as a
+	INNER JOIN wx_user AS u ON u.user_id = a.user_id
+	INNER JOIN company AS c ON c.company_id = u.company_id ORDER BY create_time DESC `
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }
-