This commit is contained in:
mmrbnjd
2025-08-04 11:24:29 +03:30
parent 00136a7078
commit d153c4bde0
2 changed files with 25 additions and 17 deletions

View File

@@ -44,8 +44,8 @@ namespace Hushian.Application.Services
.Select(s => new ChatItemDto()
{
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
@@ -77,9 +77,9 @@ namespace Hushian.Application.Services
.Where(w => w.CompanyID == CompanyID && w.Status == status)
.Select(s => new ChatItemDto()
{
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
@@ -121,8 +121,8 @@ namespace Hushian.Application.Services
return await request.Select(s => new ChatItemDto()
{
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
@@ -184,8 +184,8 @@ namespace Hushian.Application.Services
.Select(s => new ChatItemDto()
{
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
@@ -340,7 +340,7 @@ namespace Hushian.Application.Services
public async Task<bool> MarkAsReadChatItem(int ID, ConversationType Type, int? ExperID)
{
var item = await _ConversationResponseRepository.Get()
.Include(inc => inc.conversation).FirstOrDefaultAsync(w => w.ID == ID && !w.ExperID.HasValue
.Include(inc => inc.conversation).FirstOrDefaultAsync(w => w.ID == ID /*&& !w.ExperID.HasValue*/
&& w.conversation.Status != ConversationStatus.Finished);
if (item != null)
@@ -377,8 +377,8 @@ namespace Hushian.Application.Services
.Select(s => new ChatItemDto()
{
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l=>l.ExperID.HasValue).ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
@@ -418,8 +418,8 @@ namespace Hushian.Application.Services
.Select(s => new ChatItemDto()
{
ID = s.ID,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,