kobe6258 7 months ago
parent
commit
40fff9c0dd
2 changed files with 8 additions and 1 deletions
  1. 4 1
      controllers/audio.go
  2. 4 0
      controllers/video.go

+ 4 - 1
controllers/audio.go

@@ -349,6 +349,7 @@ func (this *AudioController) AudioList() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	sortType := this.GetString("SortType")
+	KeyWord := this.GetString("KeyWord")
 	var condition string
 	var pars []interface{}
 
@@ -358,7 +359,9 @@ func (this *AudioController) AudioList() {
 	if currentIndex <= 0 {
 		currentIndex = 1
 	}
-
+	if KeyWord != "" {
+		condition += " AND author_name like '%" + KeyWord + "%'"
+	}
 	sortCondition := " ORDER BY published_time "
 	if sortType == "" {
 		sortType = "DESC"

+ 4 - 0
controllers/video.go

@@ -351,6 +351,7 @@ func (this *VideoController) VideoList() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	sortType := this.GetString("SortType")
+	KeyWord := this.GetString("KeyWord")
 	var condition string
 	var pars []interface{}
 
@@ -360,6 +361,9 @@ func (this *VideoController) VideoList() {
 	if currentIndex <= 0 {
 		currentIndex = 1
 	}
+	if KeyWord != "" {
+		condition += " AND author_name like '%" + KeyWord + "%'"
+	}
 	sortCondition := " ORDER BY published_time "
 	if sortType == "" {
 		sortType = "DESC"