Merge branch 'main' into v17/dev
This commit is contained in:
@@ -1671,6 +1671,27 @@ public class DocumentRepository : ContentRepositoryBase<int, IContent, DocumentR
|
||||
return MapDtosToContent(Database.Fetch<DocumentDto>(sql));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<Guid> GetScheduledContentKeys(Guid[] keys)
|
||||
{
|
||||
var action = ContentScheduleAction.Release.ToString();
|
||||
DateTime now = DateTime.UtcNow;
|
||||
|
||||
Sql<ISqlContext> sql = SqlContext.Sql();
|
||||
sql
|
||||
.Select<NodeDto>(x => x.UniqueId)
|
||||
.From<DocumentDto>()
|
||||
.InnerJoin<ContentDto>().On<DocumentDto, ContentDto>(left => left.NodeId, right => right.NodeId)
|
||||
.InnerJoin<NodeDto>().On<ContentDto, NodeDto>(left => left.NodeId, right => right.NodeId)
|
||||
.WhereIn<NodeDto>(x => x.UniqueId, keys)
|
||||
.WhereIn<NodeDto>(x => x.NodeId, Sql()
|
||||
.Select<ContentScheduleDto>(x => x.NodeId)
|
||||
.From<ContentScheduleDto>()
|
||||
.Where<ContentScheduleDto>(x => x.Action == action && x.Date >= now));
|
||||
|
||||
return Database.Fetch<Guid>(sql);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<IContent> GetContentForExpiration(DateTime date)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user