|
@@ -9,6 +9,7 @@ import (
|
|
|
"github.com/tealeg/xlsx"
|
|
|
"os"
|
|
|
"path/filepath"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -152,15 +153,34 @@ func (this *EdbInfoController) YongyiSearchList() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ list := make([]*data_manage.BaseFromYongyiIndexSearchItem, 0)
|
|
|
+ var err error
|
|
|
//关键字
|
|
|
keyword := this.GetString("Keyword")
|
|
|
+ if keyword != "" {
|
|
|
+ keyWordArr := strings.Split(keyword, " ")
|
|
|
|
|
|
- // todo es 模糊搜索
|
|
|
- list, err := data_manage.GetYongyiItemList(keyword)
|
|
|
- if err != nil {
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- br.Msg = "获取失败"
|
|
|
- return
|
|
|
+ if len(keyWordArr) > 0 {
|
|
|
+ condition := ""
|
|
|
+ for _, v := range keyWordArr {
|
|
|
+ condition += ` AND CONCAT(index_name,index_code) LIKE '%` + v + `%'`
|
|
|
+ }
|
|
|
+ list, err = data_manage.GetYongyiItemList(condition)
|
|
|
+ if err != nil {
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // todo es 模糊搜索
|
|
|
+ list, err = data_manage.GetYongyiItemList("")
|
|
|
+ if err != nil {
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
br.Ret = 200
|