Browse Source

Merge remote-tracking branch 'origin/develop' into develop

沈静伟 3 years ago
parent
commit
d948464bd3

+ 8 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/前十新品.sql

@@ -0,0 +1,8 @@
+SELECT top 10 t1.fprodname,t1.tagents_productid, t2.fbrand, t2.fagentname, t2.faddress
+FROM TAGENTS_PRODUCT t1
+         LEFT JOIN tagents t2
+                   ON t1.tagentsid = t2.tagentsid
+WHERE t1.fprodclassname = $fprodclassname$
+  and t1.siteid = $siteid$
+  AND t1.fisonsale = 1
+ORDER BY t1.createdate DESC

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/搜索_直播.sql

@@ -25,4 +25,4 @@ select t1.tliveid,
 from tlive t1
          inner join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
 WHERE t1.siteid = $siteid$
-  and (t1.createby LIKE $keyStr$ OR t1.channelname LIKE $keyStr$)
+  and (t1.createby LIKE $keyStr$ OR t1.channelname LIKE $keyStr$ OR t2.fagentname LIKE $keyStr$ OR t1.categoryname LIKE $keyStr$)

+ 3 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/最新管理端发布的通告.sql

@@ -1,4 +1,4 @@
-SELECT t1.tnoticeid,
+SELECT top 10 t1.tnoticeid,
        t1.ftype,
        t1.ftitle,
        t1.fsummary,
@@ -20,4 +20,6 @@ FROM tnotice AS t1
 WHERE  t1.ftype = '¹Ù·½'
   AND t1.fishomepage = 1
   AND t1.fstatus = '·¢²¼'
+  AND t1.fisontop = 0
+ORDER BY t1.createdate DESC
 

+ 25 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/最新管理端发布的通告_置顶.sql

@@ -0,0 +1,25 @@
+SELECT t1.tnoticeid,
+       t1.ftype,
+       t1.ftitle,
+       t1.fsummary,
+       t1.fcontent,
+       t1.checkdate,
+       t1.fisontop,
+       t1.fbegdate,
+       t1.fenddate,
+       t1.fstatus,
+       t1.freadcount,
+       t1.checkby,
+       t1.fisagentsubuser,
+       t1.fischeckagent,
+       t1.fishomepage,
+       t1.fissingleagent,
+       t1.fisspecifiedrange,
+       t1.tenterprise_userid
+FROM tnotice AS t1
+WHERE  t1.ftype = '¹Ù·½'
+  AND t1.fishomepage = 1
+  AND t1.fstatus = '·¢²¼'
+  AND t1.fisontop = 1
+ORDER BY t1.createdate DESC
+

+ 18 - 4
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -179,12 +179,14 @@ public class homepage extends Controller {
      * 获取管理端发布的最新通告
      */
     public String getNewestNoticeList() {
-        SQLFactory sql = new SQLFactory(this, "最新管理端发布的通告", pageSize, pageNumber, "t1.createdate DESC");
-        Rows rows = sql.runSqlQuery();
+        SQLFactory sqlTop = new SQLFactory(this, "最新管理端发布的通告_置顶");
+        Rows rows = sqlTop.runSqlQuery();
+        SQLFactory sql = new SQLFactory(this, "最新管理端发布的通告");
+        rows.addAll(sql.runSqlQuery());
         for (Row row : rows) {
             row.put("attinfos", getAttachmentUrl("tnotice", row.getString("tnoticeid")));
         }
-        return getSucReturnObject().setDataByPaging(rows).preloading(1).toString();
+        return getSucReturnObject().setData(rows).toString();
     }
 
     /**
@@ -315,7 +317,7 @@ public class homepage extends Controller {
             sqlFactory_tlive.addParameter("keyStr", "%" + keyStr + "%");
             Rows row_tlive = dbConnect.runSqlQuery(sqlFactory_tlive.getSQL());
 
-            for(Row row:row_tlive){
+            for (Row row : row_tlive) {
                 //观看次数(次)
                 String channelid = row.getString("channelid");
                 //观看人数(人)
@@ -376,4 +378,16 @@ public class homepage extends Controller {
         return rows.isEmpty() ? 0 : rows.get(0).getLong(fieldname);
     }
 
+    public String getNewProduct() {
+        String fprodclassname = content.getString("fprodclassname");
+        SQLFactory prodlistSql = new SQLFactory(this, "前十新品");
+        prodlistSql.addParameter("siteid", siteid);
+        prodlistSql.addParameter("fprodclassname", fprodclassname);
+        Rows rows = dbConnect.runSqlQuery(prodlistSql.getSQL());
+        for (Row row : rows) {
+            row.put("attinfos", getAttachmentUrl("tagents_product", row.getString("tagents_productid")));
+        }
+        return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
+    }
+
 }