浏览代码

no message

xingzai 1 年之前
父节点
当前提交
ce37a4c7d7
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 8 2
      controllers/yanxuan_special.go
  2. 1 1
      models/cygx_yanxuan_special.go

+ 8 - 2
controllers/yanxuan_special.go

@@ -57,8 +57,14 @@ func (this *YanxuanSpecialNoLoginController) List() {
 	var pars []interface{}
 	var pars []interface{}
 
 
 	if specialColumnId > 0 {
 	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 `
 	condition += ` AND a.status = 3 `

+ 1 - 1
models/cygx_yanxuan_special.go

@@ -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) {
 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 != "" {
 	if condition != "" {
 		sqlCount += condition
 		sqlCount += condition
 	}
 	}