Преглед на файлове

商品列表查询是否上架条件调整

沈静伟 преди 4 години
родител
ревизия
0f4d34b0e4
променени са 1 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 6 4
      src/dsb/com/cnd3b/restcontroller/customer/products/products.java

+ 6 - 4
src/dsb/com/cnd3b/restcontroller/customer/products/products.java

@@ -50,10 +50,12 @@ public class products extends Controller {
                 where.append("or t1.ftag like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
-            if (whereObject.getBooleanValue("fisonsale")) {
-                where.append(" and t1.fisonsale=1 ");
-            } else {
-                where.append(" and t1.fisonsale=0 ");
+            if (whereObject.containsKey("fisonsale") && !"".equals(whereObject.getString("fisonsale"))) {
+                if (whereObject.getBooleanValue("fisonsale")) {
+                    where.append(" and t1.fisonsale=1 ");
+                } else {
+                    where.append(" and t1.fisonsale=0 ");
+                }
             }
         }
         SQLFactory sql = new SQLFactory(this, "ÉÌÆ·Áбí²éѯ", pageSize, pageNumber, sort);