api noti เพิ่มฟารอ่านข้อความ
This commit is contained in:
parent
a1bd2ec4b8
commit
78b0ad7d1d
8 changed files with 17042 additions and 12 deletions
|
|
@ -48,7 +48,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
|||
|
||||
var data_search = await _dbContext.Set<Inbox>()
|
||||
.Where(x => x.ReceiverUserId == profile.Id)
|
||||
.Where(x => x.IsOpen == false)
|
||||
.Where(x => x.DeleteDate == null)
|
||||
.OrderByDescending(x => x.ReceiveDate)
|
||||
.Select(x => new InboxResponse
|
||||
{
|
||||
|
|
@ -67,7 +67,8 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
|||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
var _data = new { data, total = data_search.Count() };
|
||||
|
||||
var _data = new { data, total = data_search.Count(), totalNoti = data_search.Where(x => x.IsOpen == false).Count() };
|
||||
return _data;
|
||||
}
|
||||
catch
|
||||
|
|
@ -85,7 +86,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
|||
|
||||
if (inbox != null)
|
||||
{
|
||||
inbox.IsOpen = true;
|
||||
inbox.DeleteDate = DateTime.Now;
|
||||
// _dbContext.Set<Inbox>().Remove(inbox);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
|
|
@ -105,6 +106,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
|||
|
||||
if (inbox != null)
|
||||
{
|
||||
inbox.IsOpen = true;
|
||||
inbox.OpenDate = DateTime.Now;
|
||||
// _dbContext.Set<Inbox>().Remove(inbox);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue