Просмотр исходного кода

wip:项目名分词字段修改

wangkaiyue 1 год назад
Родитель
Сommit
bc76c60c73

+ 1 - 1
src/jfw/modules/bigmember/src/entity/portraitBuyerSearch.go

@@ -98,7 +98,7 @@ func BuyerPortraitSearch(screen *PortraitScreen) (map[string]interface{}, error)
 	//文本输入框,字数限制50个字,超过上限不再允许输入内容
 	if screen.Match != "" {
 		if pareWord := screen.PareMatchWord(); pareWord != "" {
-			findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(), "\",\""))
+			findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(true), "\",\""))
 			var keywordArr []string
 			for _, keyword := range strings.Split(pareWord, " ") {
 				if keyword == "" {

+ 1 - 1
src/jfw/modules/bigmember/src/entity/portraitWinnerSearch.go

@@ -188,7 +188,7 @@ func GetWinnerPortraitSearch(screen *PortraitScreen) (map[string]interface{}, er
 		//文本输入框,字数限制50个字,超过上限不再允许输入内容
 		if screen.Match != "" {
 			if pareWord := screen.PareMatchWord(); pareWord != "" {
-				findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(), "\",\""))
+				findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(true), "\",\""))
 				var keywordArr []string
 				for _, keyword := range strings.Split(pareWord, " ") {
 					if keyword == "" {

+ 12 - 4
src/jfw/modules/bigmember/src/entity/portrait_screen.go

@@ -82,7 +82,7 @@ func (pwp *PortraitScreen) PareMatchWord() string {
 }
 
 // PareMatchType 格式筛选搜索,默认筛选为标题和正文
-func (ps *PortraitScreen) PareMatchType() (items []string) {
+func (ps *PortraitScreen) PareMatchType(isProject bool) (items []string) {
 	for _, t := range strings.Split(ps.MatchRange, ",") {
 		if t == "buyer" {
 			items = append(items, "buyer.mbuyer")
@@ -91,11 +91,19 @@ func (ps *PortraitScreen) PareMatchType() (items []string) {
 		} else if t == "agency" {
 			items = append(items, "agency.magency")
 		} else if t == "purchasing" {
-			items = append(items, []string{"purchasing", "projectname.pname"}...)
+			if isProject {
+				items = append(items, []string{"purchasing", "projectname.sname"}...)
+			} else {
+				items = append(items, []string{"purchasing", "projectname.pname"}...)
+			}
 		}
 	}
 	if len(items) == 0 { //默认查询项目名称和标的物
-		items = append(items, []string{"purchasing", "projectname.pname"}...)
+		if isProject {
+			items = append(items, []string{"purchasing", "projectname.sname"}...)
+		} else {
+			items = append(items, []string{"purchasing", "projectname.pname"}...)
+		}
 	}
 	ps.ShowMatch = strings.Join(items, ",")
 	return
@@ -187,7 +195,7 @@ func (pwp *PortraitProjectScreen) CommonPare(isWinner bool) (mustQueryArr []stri
 		if pareWord := pwp.Screen.PareMatchWord(); pareWord != "" {
 			pwp.Screen.KeyWordArr = nil
 			var keywordQueryArr []string
-			findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(), "\",\""))
+			findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(false), "\",\""))
 			for _, keyword := range strings.Split(pareWord, " ") {
 				if keyword == "" {
 					continue

+ 0 - 4
src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go

@@ -208,8 +208,6 @@ func (this *EntPortrait) WinnerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(true)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, entId, "winnerPortrait")
 		if err != nil {
@@ -424,8 +422,6 @@ func (this *EntPortrait) BuyerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(false)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, buyer, "buyerPortrait")
 		if err != nil {

+ 0 - 4
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -147,8 +147,6 @@ func (this *SubVipPortrait) WinnerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(true)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, entId, "winnerPortrait")
 		if err != nil {
@@ -406,8 +404,6 @@ func (this *SubVipPortrait) BuyerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(false)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, buyer, "buyerPortrait")
 		if err != nil {