@@ -57,8 +57,14 @@ func (this *YanxuanSpecialNoLoginController) List() {
var pars []interface{}
if specialColumnId > 0 {
- condition += ` AND b.id = ? `
- pars = append(pars, specialColumnId)
+ authorItem, err := models.GetYanxuanSpecialAuthorById(specialColumnId)
+ if err != nil {
+ br.Msg = "查询栏目详情失败!"
+ br.ErrMsg = "查询栏目详情失败,Err:" + err.Error()
+ return
+ }
+ condition += ` AND a.user_id = ? `
+ pars = append(pars, authorItem.UserId)
}
condition += ` AND a.status = 3 `
@@ -245,7 +245,7 @@ JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
// 获取数量
func GetCygxYanxuanSpecialCount(condition string, pars []interface{}) (count int, err error) {
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_yanxuan_special WHERE 1= 1 `
+ sqlCount := ` SELECT COUNT(1) AS count FROM cygx_yanxuan_special as a WHERE 1= 1 `
if condition != "" {
sqlCount += condition