zhijiezhao 3 년 전
부모
커밋
c75b8c469f
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/main/java/com/caimei365/commodity/service/impl/SearchProductServiceImpl.java

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

@@ -81,13 +81,13 @@ public class SearchProductServiceImpl implements SearchProductService {
         if (promotionFlag == 1) {
             filterList.add("p_promotions_id > 0");
         }
-        log.info("brandIds = "+ brandIds+"------------------------------------------------------------------------");
+        log.info("brandIds = " + brandIds + "------------------------------------------------------------------------");
         if (!StringUtils.isEmpty(brandIds) && !"null".equals(brandIds)) {
             StringBuffer brandBuilder = new StringBuffer();
             if (brandIds.contains(",")) {
                 String[] split = brandIds.split(",");
                 for (int i = 0; i < split.length; i++) {
-                    if (i == 0) {
+                    if (i == 0 && "null" != split[i] && split[i] != null) {
                         brandBuilder.append("p_brand_id=").append(split[i]);
                     } else {
                         brandBuilder.append(" OR p_brand_id=").append(split[i]);
@@ -241,13 +241,13 @@ public class SearchProductServiceImpl implements SearchProductService {
         if (promotionFlag == 1) {
             filterList.add("p_promotions_id > 0");
         }
-        log.info("brandIds = "+ brandIds+"------------------------------------------------------------------------");
+        log.info("brandIds = " + brandIds + "------------------------------------------------------------------------");
         if (!StringUtils.isEmpty(brandIds) && !"null".equals(brandIds)) {
             StringBuffer brandBuilder = new StringBuffer();
             if (brandIds.contains(",")) {
                 String[] split = brandIds.split(",");
                 for (int i = 0; i < split.length; i++) {
-                    if (i == 0) {
+                    if (i == 0 && "null" != split[i] && split[i] != null) {
                         brandBuilder.append("p_brand_id=").append(split[i]);
                     } else {
                         brandBuilder.append(" OR p_brand_id=").append(split[i]);