fix:修复批量新增推送记录缺失创建时间

This commit is contained in:
hardstylewyl 2025-04-15 16:57:37 +08:00
parent 3bbd633259
commit 24a80c7a50

View File

@ -36,7 +36,11 @@ public class TrackPushRecordEsRepository : ElasticSearchContextAbstract<TrackPus
if (!records.Any()) return;
// 按天写入es
var indexName = $"{GlobalConst.TrackPushRecordIndex}-{DateTime.Now:yyyy.MM.dd}";
records.ForEach(x => x.IndexName = indexName);
records.ForEach(x =>
{
x.IndexName = indexName;
x.CreateTime = DateTime.Now;
});
var r = await Context.IndexManyAsync(records, indexName);