@@ -52,7 +52,7 @@ func (this *YanxuanSpecialController) List() {
condition += ` AND a.status = 2 `
- list, tmpErr := models.GetYanxuanSpecialList(condition, pars)
+ list, tmpErr := models.GetYanxuanSpecialList(sysUser.UserId, condition, pars)
if tmpErr != nil {
br.Msg = "获取失败"
br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
@@ -486,7 +486,7 @@ func (this *YanxuanSpecialController) Center() {
condition += ` AND a.status = ? `
pars = append(pars, status)
+ list, tmpErr := models.GetYanxuanSpecialList(sysUser.UserId,condition, pars)
@@ -48,7 +48,7 @@ type CygxYanxuanSpecialItem struct {
IsCollect int
}
-func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpecialItem, err error) {
+func GetYanxuanSpecialList(userId int, condition string, pars []interface{}) (items []*CygxYanxuanSpecialItem, err error) {
o := orm.NewOrm()
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,
@@ -61,7 +61,7 @@ JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
sql += condition
sql += `ORDER BY a.publish_time DESC `
- _, err = o.Raw(sql, pars).QueryRows(&items)
+ _, err = o.Raw(sql, userId,pars).QueryRows(&items)
return