Browse Source

no message

xingzai 11 months ago
parent
commit
ac527df885
1 changed files with 9 additions and 0 deletions
  1. 9 0
      controllers/cygx/yanxuan_special.go

+ 9 - 0
controllers/cygx/yanxuan_special.go

@@ -323,6 +323,7 @@ func (this *YanxuanSpecialController) AuthorList() {
 // @Param   Status   query   string  true       "状态: 1:待审核 、 2:已发布 。默认待审核"
 // @Param   Type   query   int  true       "文章类型,1:笔记、2:观点"
 // @Param   KeyWord   query   string  false       "搜索关键词"
+// @Param   NickName   query   string  false       "昵称"
 // @Param   SortParam   query   string  false       "排序字段参数,用来排序的字段, 枚举值:'CreatTime':开通时间 、 'articleNum':已发布文章 、 'pv':总Pv/Uv "
 // @Param   SortType   query   string  true       "如何排序,是正序还是倒序,枚举值:`asc 正序`,`desc 倒叙`"
 // @Param   StartDate   query   string  false       "开始时间 ,列如2021-03-06 "
@@ -354,6 +355,7 @@ func (this *YanxuanSpecialController) List() {
 	sortType := this.GetString("SortType")
 	startDate := this.GetString("StartDate")
 	endDate := this.GetString("EndDate")
+	nickName := this.GetString("NickName")
 
 	var startSize int
 	if pageSize <= 0 {
@@ -397,6 +399,13 @@ func (this *YanxuanSpecialController) List() {
 		pars = append(pars, keyWord)
 	}
 
+	//昵称搜索
+	if nickName != "" {
+		nickName = "%" + nickName + "%"
+		condition += ` AND b.nick_name like  ? `
+		pars = append(pars, nickName)
+	}
+
 	//排序字段以及排序方式处理
 	var sortStr string
 	if sortParam != "" && sortType != "" {