Explorar o código

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

沈静伟 %!s(int64=4) %!d(string=hai) anos
pai
achega
0f4d34b0e4

+ 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);