Bladeren bron

Merge branch 'develop-green' into develop2

hu 9 maanden geleden
bovenliggende
commit
1833ba84b0
1 gewijzigde bestanden met toevoegingen van 5 en 4 verwijderingen
  1. 5 4
      src/custom/restcontroller/webmanage/sale/promotion/promotion.java

+ 5 - 4
src/custom/restcontroller/webmanage/sale/promotion/promotion.java

@@ -189,6 +189,7 @@ public class promotion extends Controller {
     @CACHEING
     public String queryItemList() throws YosException {
         StringBuffer where = new StringBuffer(" 1=1 ");
+        StringBuffer where1 = new StringBuffer(" 1=1 ");
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
@@ -202,9 +203,9 @@ public class promotion extends Controller {
                 where.append(")");
             }
             if (whereObject.containsKey("isonsale") && !"".equals(whereObject.getString("isonsale"))) {
-                where.append(" and(");
-                where.append("t1.isonsale ='").append(whereObject.getString("isonsale")).append("' ");
-                where.append(")");
+                where1.append(" and(");
+                where1.append("t1.isonsale ='").append(whereObject.getString("isonsale")).append("' ");
+                where1.append(")");
             }
             if (whereObject.containsKey("isservice") && !"".equals(whereObject.getString("isservice"))) {
                 where.append(" and(");
@@ -256,7 +257,7 @@ public class promotion extends Controller {
         }
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_item");
-        querySQL.addJoinTable(BaseClass.JOINTYPE.inner, "(select DISTINCT t1.itemid,t1.siteid from sa_promotion_items t1 inner join sa_promotion t2 on t1.sa_promotionid=t2.sa_promotionid and t1.siteid=t2.siteid)", "t2", "t1.itemid=t2.itemid and t1.siteid=t2.siteid ");
+        querySQL.addJoinTable(BaseClass.JOINTYPE.inner, "(select DISTINCT t1.itemid,t1.siteid from sa_promotion_items t1 inner join sa_promotion t2 on t1.sa_promotionid=t2.sa_promotionid and t1.siteid=t2.siteid where "+where1+")", "t2", "t1.itemid=t2.itemid and t1.siteid=t2.siteid ");
         querySQL.setWhere(where);
         querySQL.setWhere("t1.siteid", siteid);
         querySQL.setTableAlias("t1");