Sfoglia il codice sorgente

自动下架单品

eganwu 1 anno fa
parent
commit
59e96df78e
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. 12 0
      src/custom/service/AutoPublishNoticeService.java

+ 12 - 0
src/custom/service/AutoPublishNoticeService.java

@@ -46,6 +46,18 @@ public class AutoPublishNoticeService extends ServiceController {
             updateSQL.setSiteid(row.getString("siteid"));
             sqlList.add(updateSQL.getSQL());
         }
+
+        //自动下架单品
+        rows = dbConnect.runSqlQuery("SELECT * from sa_fad WHERE isonsale=1 and offsaledate<=CURRENT_TIME");
+        for (Row row : rows) {
+            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(dbConnect, "sa_fad");
+            updateSQL.setValue("isonsale", 0);
+            updateSQL.setValue("onsaleby", "null");
+            updateSQL.setValue("onsaledate", "null");
+            updateSQL.setUniqueid(row.getLong("sa_fadid"));
+            updateSQL.setSiteid(row.getString("siteid"));
+            sqlList.add(updateSQL.getSQL());
+        }
         if (sqlList.size() > 0) {
             dbConnect.runSqlUpdate(sqlList);
         }