Pārlūkot izejas kodu

查询营销类别添加ishide

hu 1 gadu atpakaļ
vecāks
revīzija
847c85dd01

+ 1 - 0
src/custom/restcontroller/webmanage/sale/itemclass/SQL/查询所有分类.sql

@@ -28,6 +28,7 @@ with recursive saleclass as (select t1.itemclassid,
                                   saleclass t3
                              where t2.siteid = $siteid$
                                and t2.classtype='营销'
+                               and $where2$
                                and t2.sa_brandid = $sa_brandid$
                                and t2.itemclassid = t3.parentid)
 select *

+ 5 - 0
src/custom/restcontroller/webmanage/sale/itemclass/itemclass.java

@@ -196,14 +196,17 @@ public class itemclass extends Controller {
 //		}
 
 		String where = " 1=1 ";
+		String where2 = " 1=1 ";
 		if (content.containsKey("where")) {
 			JSONObject whereObject = content.getJSONObject("where");
 
 			if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
 				where = where + " and (ifnull(t1.istool,0) ='" + whereObject.getString("istool") + "') ";
+				where2=where2+  " and (ifnull(t2.istool,0) ='" + whereObject.getString("istool") + "') ";
 			}
 			if (whereObject.containsKey("ishide") && !"".equals(whereObject.getString("ishide"))) {
 				where = where + " and (ifnull(t1.ishide,0) ='" + whereObject.getString("ishide") + "') ";
+				where2=where2+  " and (ifnull(t2.ishide,0) ='" + whereObject.getString("ishide") + "') ";
 			}
 		}
 		/*
@@ -236,6 +239,8 @@ public class itemclass extends Controller {
 				sqlFactory.addParameter("sa_brandid", row.getString("sa_brandid"));
 
 				sqlFactory.addParameter_SQL("where", where);
+				sqlFactory.addParameter_SQL("where2", where2);
+
 				String sql = sqlFactory.getSQL();
 				Rows allrows = dbConnect.runSqlQuery(sql);
 				/*