zhijiezhao 3 年之前
父节点
当前提交
65b8142463

+ 1 - 1
src/main/java/com/caimei365/commodity/components/PriceUtilService.java

@@ -155,10 +155,10 @@ public class PriceUtilService {
                         LadderPriceVo lowerPrice = priceMapper.findLowerLadderPrice(price.getProductId());
                         LadderPriceVo lowerBuyNum = priceMapper.findMaxLadderPrice(price.getProductId());
                         if (null != lowerPrice) {
-                            price.setPrice(lowerPrice.getBuyPrice());
                             price.setMaxBuyNumber(lowerPrice.getBuyNum());
                             if (null != lowerBuyNum) {
                                 price.setMinBuyNumber(lowerBuyNum.getBuyNum());
+                                price.setPrice(lowerBuyNum.getBuyPrice());
                             }
                         } else {
                             price.setLadderPriceFlag(0);

+ 8 - 4
src/main/java/com/caimei365/commodity/service/impl/SearchProductServiceImpl.java

@@ -156,11 +156,15 @@ public class SearchProductServiceImpl implements SearchProductService {
             if (1 == resultJson.getInt("status")) {
                 JSONArray pageData = resultJson.getJSONArray("items");
                 for (int i = 0; i < pageData.length(); i++) {
-                    HashMap<String, Object> map = new HashMap<>();
                     JSONObject json = pageData.getJSONObject(i);
-                    map.put("id", json.getInt("p_brand_id"));
-                    map.put("name", json.getString("p_brand_name"));
-                    maps.add(map);
+                    int brandId = json.getInt("p_brand_id");
+                    String brandName = json.getString("p_brand_name");
+                    if (brandId > 0 && StringUtils.isNotEmpty(brandName)) {
+                        HashMap<String, Object> map = new HashMap<>();
+                        map.put("id", brandId);
+                        map.put("name", brandName);
+                        maps.add(map);
+                    }
                 }
                 // 阿里云查询出json转换成商品pojo
                 result = ResponseJson.success(maps);