|
@@ -57,7 +57,7 @@ type Doc struct {
|
|
}
|
|
}
|
|
|
|
|
|
func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpeciaResplItem, err error) {
|
|
func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpeciaResplItem, err error) {
|
|
- o := orm.NewOrm()
|
|
|
|
|
|
+ o := orm.NewOrmUsingDB("hz_cygx")
|
|
sql := ``
|
|
sql := ``
|
|
sql = `SELECT a.*,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.bg_img,b.head_img,b.introduction,b.label,b.mobile,b.nick_name,b.real_name,b.special_name
|
|
FROM cygx_yanxuan_special AS a
|
|
FROM cygx_yanxuan_special AS a
|
|
@@ -78,7 +78,7 @@ type EnableCygxYanxuanSpecialReq struct {
|
|
}
|
|
}
|
|
|
|
|
|
func EnableYanxuanSpecial(id, status int, reason string) (err error) {
|
|
func EnableYanxuanSpecial(id, status int, reason string) (err error) {
|
|
- o := orm.NewOrm()
|
|
|
|
|
|
+ o := orm.NewOrmUsingDB("hz_cygx")
|
|
sql := ``
|
|
sql := ``
|
|
sql = `UPDATE cygx_yanxuan_special SET status=?,reason=?,publish_time=NOW() WHERE id = ? `
|
|
sql = `UPDATE cygx_yanxuan_special SET status=?,reason=?,publish_time=NOW() WHERE id = ? `
|
|
_, err = o.Raw(sql, status, reason, id).Exec()
|
|
_, err = o.Raw(sql, status, reason, id).Exec()
|
|
@@ -117,7 +117,7 @@ type CygxYanxuanSpecialItem struct {
|
|
}
|
|
}
|
|
|
|
|
|
func GetYanxuanSpecialFollowUserById(specialId int) (items []int, err error) {
|
|
func GetYanxuanSpecialFollowUserById(specialId int) (items []int, err error) {
|
|
- o := orm.NewOrm()
|
|
|
|
|
|
+ o := orm.NewOrmUsingDB("hz_cygx")
|
|
sql := ``
|
|
sql := ``
|
|
sql = `SELECT b.user_id
|
|
sql = `SELECT b.user_id
|
|
FROM cygx_yanxuan_special AS a
|
|
FROM cygx_yanxuan_special AS a
|
|
@@ -128,7 +128,7 @@ JOIN cygx_yanxuan_special_follow AS b ON a.user_id = b.follow_user_id
|
|
}
|
|
}
|
|
|
|
|
|
func GetYanxuanSpecialItemById(specialId int) (item *CygxYanxuanSpecialItem, err error) {
|
|
func GetYanxuanSpecialItemById(specialId int) (item *CygxYanxuanSpecialItem, err error) {
|
|
- o := orm.NewOrm()
|
|
|
|
|
|
+ o := orm.NewOrmUsingDB("hz_cygx")
|
|
sql := ``
|
|
sql := ``
|
|
sql = `SELECT a.*,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,
|
|
sql = `SELECT a.*,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,
|
|
b.nick_name,b.real_name,b.special_name
|
|
b.nick_name,b.real_name,b.special_name
|
|
@@ -137,4 +137,4 @@ JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
|
|
WHERE a.id=? `
|
|
WHERE a.id=? `
|
|
err = o.Raw(sql, specialId).QueryRow(&item)
|
|
err = o.Raw(sql, specialId).QueryRow(&item)
|
|
return
|
|
return
|
|
-}
|
|
|
|
|
|
+}
|