|
@@ -1016,6 +1016,14 @@ public abstract class SnapshotApplicationBase
|
|
.LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
|
|
.LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
|
|
.LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
|
|
.LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
|
|
.Where((receiver, notify) => receiver.ReceiverId == _sessionContext.UserId)
|
|
.Where((receiver, notify) => receiver.ReceiverId == _sessionContext.UserId)
|
|
|
|
+ .GroupBy((receiver, notify, bulletin) => new
|
|
|
|
+ {
|
|
|
|
+ notify.Title,
|
|
|
|
+ notify.ExternalId,
|
|
|
|
+ bulletin.SnapshotBulletinTypeName,
|
|
|
|
+ bulletin.VideoCoverImgUrl,
|
|
|
|
+ notify.CreationTime
|
|
|
|
+ })
|
|
.OrderByDescending((receiver, notify) => notify.CreationTime)
|
|
.OrderByDescending((receiver, notify) => notify.CreationTime)
|
|
.Select((receiver, notify, bulletin) => new VideoBulletinOutDto
|
|
.Select((receiver, notify, bulletin) => new VideoBulletinOutDto
|
|
{
|
|
{
|
|
@@ -1026,15 +1034,21 @@ public abstract class SnapshotApplicationBase
|
|
VideoCoverImgUrl = bulletin.VideoCoverImgUrl,
|
|
VideoCoverImgUrl = bulletin.VideoCoverImgUrl,
|
|
}).FirstAsync();
|
|
}).FirstAsync();
|
|
|
|
|
|
- outDto.Bulletins = await _notificationReceiverRepository.Queryable()
|
|
|
|
- .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
|
|
|
|
- .Select((receiver, notify) => new PointsBulletinOutDto
|
|
|
|
- {
|
|
|
|
- BulletinId = notify.ExternalId,
|
|
|
|
- Title = notify.Title,
|
|
|
|
- }, true)
|
|
|
|
- .Take(2)
|
|
|
|
- .ToListAsync();
|
|
|
|
|
|
+ outDto.Bulletins = new PointsBulletinOutDto
|
|
|
|
+ {
|
|
|
|
+ Items = await _notificationReceiverRepository.Queryable()
|
|
|
|
+ .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
|
|
|
|
+ .Select((receiver, notify) => new PointsBulletinItemsOutDto
|
|
|
|
+ {
|
|
|
|
+ BulletinId = notify.ExternalId,
|
|
|
|
+ Title = notify.Title,
|
|
|
|
+ }, true)
|
|
|
|
+ .Take(2)
|
|
|
|
+ .ToListAsync(),
|
|
|
|
+ UnReadCount = await _notificationReceiverRepository.Queryable()
|
|
|
|
+ .Where(m => m.IsRead == false && m.ReceiverId == _sessionContext.UserId)
|
|
|
|
+ .CountAsync()
|
|
|
|
+ };
|
|
|
|
|
|
return outDto;
|
|
return outDto;
|
|
}
|
|
}
|