- SaveStoresVendorSnapshot中清除两天前的平台商品快照状态

This commit is contained in:
gazebo
2019-06-28 18:09:51 +08:00
parent e6fc253851
commit a03041d6fd
2 changed files with 12 additions and 0 deletions

View File

@@ -284,3 +284,12 @@ func GetVendorStoreSnapshot(db *DaoDB, excludeSnapshotAt time.Time) (snapshotLis
err = GetRows(db, &snapshotList, sql, time.Now().Add(-48*time.Hour), excludeSnapshotAt)
return snapshotList, err
}
func DeleteVendorStoreSnapshot(db *DaoDB, minSnapshotAt time.Time) (err error) {
_, err = ExecuteSQL(db, `
DELETE t1
FROM vendor_store_snapshot t1
WHERE t1.snapshot_at < ?
`, minSnapshotAt)
return err
}