Procházet zdrojové kódy

fixbug: 全局搜索, 店铺联想词统一

wangdy před 7 roky
rodič
revize
7941af88ab

+ 4 - 2
src/main/java/com/uas/platform/b2c/common/search/service/impl/SearcherServiceImpl.java

@@ -613,13 +613,15 @@ public class SearcherServiceImpl implements SearcherService {
             type = "all";
         }
         try {
-            if (keyword.equals("store")) {
+            if (type.equals("store")) {
                 List<VendorIntroduction> vendorIntroductions = vendorIntroductionService.getVendorIntroduction(1,1024*1024*1024,keyword,null).getContent();
                 List<Object> resultMap = FastjsonUtils.fromJsonArray(JSON.toJSONString(vendorIntroductions.stream().map(VendorIntroduction::getEnName).map(en -> {Map s = new HashMap ();s.put("name", en);return s;}).collect(Collectors.toList())
                 ));
+                result= new HashMap<>();
                 result.put("result",resultMap);
+            } else {
+                result = searchService.getSimilarKeywords(keyword, type);
             }
-            result = searchService.getSimilarKeywords(keyword, type);
         } catch (SearchException e) {
             throwSystemException(e);
         }