Просмотр исходного кода

门户商品及商户查询调整为分页并新增营销类目条件字段

沈静伟 4 лет назад
Родитель
Сommit
9e708c83a6

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商品.sql

@@ -1 +1,2 @@
-select t1.tagents_productid,t1.tagentsid,t1.fintroduction,t1.fprodname,t1.fprodclassname from tagents_product t1
+select t1.tagents_productid,t1.tagentsid,t1.fintroduction,t1.fprodname,t1.fprodclassname from tagents_product t1
+where t1.fprodclassname=$saleprodclass$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商户.sql

@@ -1 +1 @@
-select t1.tagentsid,t1.saleprodclass,t1.fbrand,t1.fagentname from tagents t1
+select t1.tagentsid,t1.saleprodclass,t1.fbrand,t1.fagentname from tagents t1 where t1.saleprodclass=$saleprodclass$

+ 5 - 3
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -33,7 +33,7 @@ public class homepage extends Controller {
      */
     public String query_typeselectList() {
         this.siteid = content.getString("siteid");
-        Rows rows = dbConnect.runSqlQuery("select ttypedetailid,fvalue as ftype from ttypedetail where ftype = '供需分类' and siteid ='"+siteid+"' and fisused=1 order by sequence");
+        Rows rows = dbConnect.runSqlQuery("select ttypedetailid,fvalue as ftype from ttypedetail where ftype = '供需分类' and siteid ='" + siteid + "' and fisused=1 order by sequence");
         RowsMap map = getAttachmentUrl("ttypedetail", rows.toArrayList("ttypedetailid"));
         for (Row row : rows) {
             row.put("attinfos", map.get(row.getString("ttypedetailid")));
@@ -106,7 +106,8 @@ public class homepage extends Controller {
      */
     public String agentList() {
         this.siteid = content.getString("siteid");
-        SQLFactory agentlistSql = new SQLFactory(this, "优质商户");
+        SQLFactory agentlistSql = new SQLFactory(this, "优质商户", pageSize, pageNumber, "t1.tagentsid");
+        agentlistSql.addParameter("saleprodclass", content.getString("saleprodclass"));
         Rows rows = agentlistSql.runSqlQuery();
         RowsMap map = getAttachmentUrl("tagents", rows.toArrayList("tagentsid"));
         for (Row row : rows) {
@@ -122,8 +123,9 @@ public class homepage extends Controller {
      */
     public String agentsMain() {
         this.siteid = content.getString("siteid");
-        SQLFactory sql = new SQLFactory(this, "优质商户详情");
+        SQLFactory sql = new SQLFactory(this, "优质商户详情", pageSize, pageNumber, "t1.tagents_productid");
         sql.addParameter("tagentsid", content.getString("tagentsid"));
+        sql.addParameter("saleprodclass", content.getString("saleprodclass"));
         Rows rows = dbConnect.runSqlQuery(sql.getSQL());
         for (Row row : rows) {
             row.put("saleprodclass", JSONArray.parseArray(row.getString("saleprodclass")));