Fix merge condition for prices.csv
This commit is contained in:
@@ -30,11 +30,11 @@ extension KissConsole {
|
||||
try [price].mergeCsv(toFile: fileUrl, merging: { this, file in
|
||||
var merged = this
|
||||
for old in file {
|
||||
if nil == this.first(where: { $0.stockBusinessDate == old.stockBusinessDate }) {
|
||||
if nil == this.first(where: { $0.stockDateTime == old.stockDateTime }) {
|
||||
merged.append(old)
|
||||
}
|
||||
}
|
||||
merged.sort(by: { $0.stockBusinessDate > $1.stockBusinessDate })
|
||||
merged.sort(by: { $0.stockDateTime > $1.stockDateTime })
|
||||
return merged
|
||||
}, localized: false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user