diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs b/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs index 28cbd4b..eb10dff 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs @@ -196,10 +196,11 @@ namespace HuanMeng.MiaoYu.Code.Chat Dao.daoDbMiaoYu.context.T_User_Chat.Add(userChatSession); Dao.daoDbMiaoYu.context.SaveChanges(); } - var notRole = new List(); - notRole.Add(ChatRole.initialization.ToString()); - notRole.Add(ChatRole.tips.ToString()); - var chatList = await Dao.daoDbMiaoYu.context.T_Chat.Where(it => it.SessionId == userChatSession.SessionId && it.UserId == _UserId && it.Type == (int)ChatType.正常 && !notRole.Contains(it.Role)).OrderBy(it => it.SendMessageDay).ToListAsync(); + var role = new List(); + role.Add(ChatRole.assistant.ToString()); + role.Add(ChatRole.user.ToString()); + + var chatList = await Dao.daoDbMiaoYu.context.T_Chat.Where(it => it.SessionId == userChatSession.SessionId && it.UserId == _UserId && role.Contains(it.Role)).OrderBy(it => it.SendMessageDay).ToListAsync(); if (chatList == null) { chatList = new List();