- 调整dao.GetVendorStoreSnapshot的实现
- updateVendorStoreStatusBySnapshot中更新本地平台门店信息
This commit is contained in:
@@ -285,17 +285,12 @@ func FormalizeStoreStatus(db *DaoDB, storeID, storeStatus int) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func GetVendorStoreSnapshot(db *DaoDB, excludeSnapshotAt time.Time) (snapshotList []*model.VendorStoreSnapshot, err error) {
|
||||
func GetVendorStoreSnapshot(db *DaoDB, snapshotAt time.Time) (snapshotList []*model.VendorStoreSnapshot, err error) {
|
||||
sql := `
|
||||
SELECT *
|
||||
FROM vendor_store_snapshot t1
|
||||
WHERE t1.snapshot_at = (
|
||||
SELECT MAX(snapshot_at) snapshot_at
|
||||
FROM vendor_store_snapshot
|
||||
WHERE snapshot_at > ? AND snapshot_at <> ?
|
||||
)
|
||||
`
|
||||
err = GetRows(db, &snapshotList, sql, time.Now().Add(-48*time.Hour), excludeSnapshotAt)
|
||||
WHERE t1.snapshot_at = ?`
|
||||
err = GetRows(db, &snapshotList, sql, snapshotAt)
|
||||
return snapshotList, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user