Ver código fonte

搜索优化

hsun 1 ano atrás
pai
commit
7efadc7282
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      controller/eta_training_video.go

+ 3 - 3
controller/eta_training_video.go

@@ -103,13 +103,13 @@ func (a *EtaTrainingVideoController) VideoPageList(c *gin.Context) {
 	pars := make([]interface{}, 0)
 	pars = append(pars, 1)
 	{
-		// 关键词
+		// 关键词-标题/简介
 		keyword := strings.TrimSpace(req.Keyword)
 		keyword = template.HTMLEscapeString(keyword)
 		if keyword != "" {
 			kw := fmt.Sprint("%", keyword, "%")
-			cond += fmt.Sprintf(` AND (%s LIKE ?)`, crm.EtaTrainingVideoColumns.Title)
-			pars = append(pars, kw)
+			cond += fmt.Sprintf(` AND (%s LIKE ? OR %s LIKE ?)`, crm.EtaTrainingVideoColumns.Title, crm.EtaTrainingVideoColumns.Introduce)
+			pars = append(pars, kw, kw)
 		}
 
 		// 分类ID