Kaynağa Gözat

前十新品

吴志根 3 yıl önce
ebeveyn
işleme
2b254bbc5c

+ 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

+ 13 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -315,7 +315,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 +376,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();
+    }
+
 }