|
|
@@ -186,28 +186,28 @@ public class itemclass extends Controller {
|
|
|
/*
|
|
|
* 过滤条件设置
|
|
|
*/
|
|
|
- String where = " 1=1 ";
|
|
|
- if (content.containsKey("where")) {
|
|
|
- JSONObject whereObject = content.getJSONObject("where");
|
|
|
-
|
|
|
- if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where = where + " and (brandname like'%" + whereObject.getString("condition") + "%') ";
|
|
|
- }
|
|
|
- }
|
|
|
+// String where = " 1=1 ";
|
|
|
+// if (content.containsKey("where")) {
|
|
|
+// JSONObject whereObject = content.getJSONObject("where");
|
|
|
+//
|
|
|
+// if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
+// where = where + " and (brandname like'%" + whereObject.getString("condition") + "%') ";
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- String where2 = " 1=1 ";
|
|
|
+ String where = " 1=1 ";
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
|
|
|
if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
|
|
|
- where2 = where2 + " and (t1.istool ='" + whereObject.getString("istool") + "') ";
|
|
|
+ where = where + " and (t1.istool ='" + whereObject.getString("istool") + "') ";
|
|
|
}
|
|
|
}
|
|
|
/*
|
|
|
* SQL通告板块查询参数设置并查询
|
|
|
*/
|
|
|
Rows rows = Enterprise.getBrands(this, sys_enterpriseid);
|
|
|
-
|
|
|
+
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
/*
|
|
|
@@ -219,7 +219,7 @@ public class itemclass extends Controller {
|
|
|
if (!enterpriseRow.isEmpty()) {
|
|
|
boolean saleclassauth = enterpriseRow.getBoolean("saleclassauth");
|
|
|
if (saleclassauth) {
|
|
|
- where2 = where2
|
|
|
+ where = where
|
|
|
+ " and t1.itemclassid in ( SELECT itemclassid from sys_enterprise_saleclass WHERE sys_enterpriseid = "
|
|
|
+ sys_enterpriseid + " and siteid='" + siteid + "')";
|
|
|
}
|
|
|
@@ -227,10 +227,12 @@ public class itemclass extends Controller {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "查询所有分类");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("sa_brandid", row.getString("sa_brandid"));
|
|
|
- sqlFactory.addParameter_SQL("where2", where2);
|
|
|
+
|
|
|
+ sqlFactory.addParameter_SQL("where", where);
|
|
|
String sql = sqlFactory.getSQL();
|
|
|
Rows allrows = dbConnect.runSqlQuery(sql);
|
|
|
/*
|
|
|
@@ -258,7 +260,7 @@ public class itemclass extends Controller {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (rows2.isNotEmpty()) {
|
|
|
if (((Rows) rows2.get(0).get("ttemclass")).isNotEmpty()) {
|
|
|
Collections.sort((Rows) rows2.get(0).get("ttemclass"), new SortByNum());
|