|
@@ -1,6 +1,7 @@
|
|
|
package service
|
|
|
|
|
|
import (
|
|
|
+ "app.yhyue.com/moapp/jybase/common"
|
|
|
elastic "app.yhyue.com/moapp/jybase/es"
|
|
|
IC "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/init"
|
|
|
"fmt"
|
|
@@ -501,7 +502,7 @@ type Operator struct {
|
|
|
Order int64
|
|
|
}
|
|
|
|
|
|
-func SearchList(operator Operator) (int64, *[]map[string]interface{}) {
|
|
|
+func SearchList(operator Operator) (int64, *[]map[string]interface{}, int64) {
|
|
|
if operator.PageSize == 0 {
|
|
|
operator.PageSize = 10
|
|
|
}
|
|
@@ -578,7 +579,7 @@ func SearchList(operator Operator) (int64, *[]map[string]interface{}) {
|
|
|
if operator.WordsMode == 1 {
|
|
|
keyArr := []string{}
|
|
|
for _, v := range strings.Split(operator.KeyWords, ",") {
|
|
|
- keyArr = append(keyArr, fmt.Sprintf(`{"match_phrase":{"%s":"%s"}`, operator.SelectType, v))
|
|
|
+ keyArr = append(keyArr, fmt.Sprintf(`{"match_phrase":{"%s":"%s"}}`, operator.SelectType, v))
|
|
|
}
|
|
|
mustArr = append(mustArr, fmt.Sprintf(shouldStr, strings.Join(keyArr, ",")))
|
|
|
} else {
|
|
@@ -832,9 +833,11 @@ func SearchList(operator Operator) (int64, *[]map[string]interface{}) {
|
|
|
fmt.Println(sqlStr, idArr)
|
|
|
data = IC.BiMysql.SelectBySql(sqlStr,
|
|
|
idArr...)
|
|
|
- return count, data
|
|
|
+ total := count
|
|
|
+ count = gconv.Int64(common.If(count > 2000, 2000, count))
|
|
|
+ return count, data, total
|
|
|
} else {
|
|
|
- return count, &[]map[string]interface{}{}
|
|
|
+ return count, &[]map[string]interface{}{}, 0
|
|
|
}
|
|
|
|
|
|
}
|