Browse Source

自动下架单品

eganwu 1 year ago
parent
commit
59e96df78e
1 changed files with 12 additions and 0 deletions
  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);
         }