Showing
1 changed file
with
4 additions
and
2 deletions
@@ -65,15 +65,17 @@ public class SceneRecommendBrandsService { | @@ -65,15 +65,17 @@ public class SceneRecommendBrandsService { | ||
65 | } | 65 | } |
66 | 66 | ||
67 | public void getRecommendBrands(Map<String, String> paramMap, SearchApiResult result) { | 67 | public void getRecommendBrands(Map<String, String> paramMap, SearchApiResult result) { |
68 | + | ||
68 | if (result != null && result.getData() != null) { | 69 | if (result != null && result.getData() != null) { |
69 | JSONObject data = (JSONObject)result.getData(); | 70 | JSONObject data = (JSONObject)result.getData(); |
70 | JSONObject commonFilters = data.getJSONObject("filter"); | 71 | JSONObject commonFilters = data.getJSONObject("filter"); |
71 | if (commonFilters != null) { | 72 | if (commonFilters != null) { |
73 | + JSONArray recommendBrands = new JSONArray(); | ||
72 | JSONArray brandList = commonFilters.getJSONArray("brand"); | 74 | JSONArray brandList = commonFilters.getJSONArray("brand"); |
73 | if (!CollectionUtils.isEmpty(brandList)) { | 75 | if (!CollectionUtils.isEmpty(brandList)) { |
74 | - JSONArray recommendBrands = getRecommendBrands(paramMap, brandList); | ||
75 | - commonFilters.put("recommendBrand", recommendBrands); | 76 | + recommendBrands = getRecommendBrands(paramMap, brandList); |
76 | } | 77 | } |
78 | + commonFilters.put("recommendBrand", recommendBrands); | ||
77 | } | 79 | } |
78 | } | 80 | } |
79 | } | 81 | } |
-
Please register or login to post a comment