소스 검색

Merge branch 'cygx_12.0.1' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 1 년 전
부모
커밋
5b6e817077
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{}
 
 	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 `

+ 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) {
-	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
 	}