|
@@ -64,38 +64,21 @@ func (pwp *PortraitScreen) PareMatchWord() string {
|
|
}
|
|
}
|
|
|
|
|
|
//PareMatchType 格式筛选搜索,默认筛选为标题和正文
|
|
//PareMatchType 格式筛选搜索,默认筛选为标题和正文
|
|
-func (ps *PortraitScreen) PareMatchType(isBidding ...bool) (items []string) {
|
|
|
|
- if len(isBidding) > 0 && isBidding[0] { //bidding表
|
|
|
|
- for _, t := range strings.Split(ps.MatchRange, ",") {
|
|
|
|
- if t == "buyer" {
|
|
|
|
- items = append(items, "mbuyer")
|
|
|
|
- } else if t == "winner" {
|
|
|
|
- items = append(items, "mwinner")
|
|
|
|
- } else if t == "agency" {
|
|
|
|
- items = append(items, "magency")
|
|
|
|
- } else if t == "purchasing" {
|
|
|
|
- items = append(items, "purchasing")
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if len(items) == 0 { //默认查询项目名称和标的物
|
|
|
|
- items = append(items, "purchasing")
|
|
|
|
- }
|
|
|
|
- } else { //project表
|
|
|
|
- for _, t := range strings.Split(ps.MatchRange, ",") {
|
|
|
|
- if t == "buyer" {
|
|
|
|
- items = append(items, "mbuyer")
|
|
|
|
- } else if t == "winner" {
|
|
|
|
- items = append(items, "mwinner")
|
|
|
|
- } else if t == "agency" {
|
|
|
|
- items = append(items, "magency")
|
|
|
|
- } else if t == "purchasing" {
|
|
|
|
- items = append(items, []string{"purchasing", "projectname.pname"}...)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if len(items) == 0 { //默认查询项目名称和标的物
|
|
|
|
|
|
+func (ps *PortraitScreen) PareMatchType() (items []string) {
|
|
|
|
+ for _, t := range strings.Split(ps.MatchRange, ",") {
|
|
|
|
+ if t == "buyer" {
|
|
|
|
+ items = append(items, "mbuyer")
|
|
|
|
+ } else if t == "winner" {
|
|
|
|
+ items = append(items, "mwinner")
|
|
|
|
+ } else if t == "agency" {
|
|
|
|
+ items = append(items, "magency")
|
|
|
|
+ } else if t == "purchasing" {
|
|
items = append(items, []string{"purchasing", "projectname.pname"}...)
|
|
items = append(items, []string{"purchasing", "projectname.pname"}...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if len(items) == 0 { //默认查询项目名称和标的物
|
|
|
|
+ items = append(items, []string{"purchasing", "projectname.pname"}...)
|
|
|
|
+ }
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -134,7 +117,7 @@ func (ps *PortraitScreen) GetProjectSelectItems(isWinner bool) (map[string]inter
|
|
entMatch = fmt.Sprintf(`{"term":{"buyer":"%s"}}`, ps.Ent)
|
|
entMatch = fmt.Sprintf(`{"term":{"buyer":"%s"}}`, ps.Ent)
|
|
}
|
|
}
|
|
doSearchSql := fmt.Sprintf(newBiddingSearchShowSql, entMatch, time.Date(time.Now().Year()-4, 1, 1, 0, 0, 0, 0, time.Local).Unix())
|
|
doSearchSql := fmt.Sprintf(newBiddingSearchShowSql, entMatch, time.Date(time.Now().Year()-4, 1, 1, 0, 0, 0, 0, time.Local).Unix())
|
|
- log.Println("GetProjectSelectItems doSearchSql", doSearchSql)
|
|
|
|
|
|
+ //log.Println("GetProjectSelectItems doSearchSql", doSearchSql)
|
|
res, _ := GetAggs(projectIndex, projectType, doSearchSql)
|
|
res, _ := GetAggs(projectIndex, projectType, doSearchSql)
|
|
if res == nil {
|
|
if res == nil {
|
|
return nil, fmt.Errorf("此企业无信息或获取信息列表检索条件出错")
|
|
return nil, fmt.Errorf("此企业无信息或获取信息列表检索条件出错")
|
|
@@ -176,7 +159,7 @@ func (pwp *PortraitProjectScreen) GetWinnerList() (list []map[string]interface{}
|
|
//文本输入框,字数限制50个字,超过上限不再允许输入内容
|
|
//文本输入框,字数限制50个字,超过上限不再允许输入内容
|
|
if pwp.Screen.Match != "" {
|
|
if pwp.Screen.Match != "" {
|
|
if pareWord := pwp.Screen.PareMatchWord(); pareWord != "" {
|
|
if pareWord := pwp.Screen.PareMatchWord(); pareWord != "" {
|
|
- findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(true), "\",\""))
|
|
|
|
|
|
+ findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(), "\",\""))
|
|
var keywordArr []string
|
|
var keywordArr []string
|
|
for _, keyword := range strings.Split(pareWord, " ") {
|
|
for _, keyword := range strings.Split(pareWord, " ") {
|
|
if keyword == "" {
|
|
if keyword == "" {
|
|
@@ -278,7 +261,7 @@ func (pwp *PortraitProjectScreen) GetBuyerList() (list []map[string]interface{},
|
|
//文本输入框,字数限制50个字,超过上限不再允许输入内容
|
|
//文本输入框,字数限制50个字,超过上限不再允许输入内容
|
|
if pwp.Screen.Match != "" {
|
|
if pwp.Screen.Match != "" {
|
|
if pareWord := pwp.Screen.PareMatchWord(); pareWord != "" {
|
|
if pareWord := pwp.Screen.PareMatchWord(); pareWord != "" {
|
|
- findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(false), "\",\""))
|
|
|
|
|
|
+ findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(), "\",\""))
|
|
var keywordArr []string
|
|
var keywordArr []string
|
|
for _, keyword := range strings.Split(pareWord, " ") {
|
|
for _, keyword := range strings.Split(pareWord, " ") {
|
|
if keyword == "" {
|
|
if keyword == "" {
|