|
|
@@ -822,6 +822,37 @@ namespace CallCenterApi.Interface.Controllers
|
|
822
|
822
|
}
|
|
823
|
823
|
|
|
824
|
824
|
/// <summary>
|
|
|
825
|
+ /// 即时通讯 - 获取最新通讯数量(单方查看)
|
|
|
826
|
+ /// </summary>
|
|
|
827
|
+ /// <param name="isread">0未读1已读2全部</param>
|
|
|
828
|
+ /// <returns></returns>
|
|
|
829
|
+ [Authority]
|
|
|
830
|
+ public ActionResult GetChatCount(int top)
|
|
|
831
|
+ {
|
|
|
832
|
+ DataTable dt = null;
|
|
|
833
|
+ int recordCount = 0;
|
|
|
834
|
+ //接收坐席Id
|
|
|
835
|
+ int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
|
|
|
836
|
+ if (top <= 0)
|
|
|
837
|
+ {
|
|
|
838
|
+ top = 50;
|
|
|
839
|
+ }
|
|
|
840
|
+ string sql = " ISNULL(a.IsDelete,0) = 0 AND ISNULL(c.F_DeleteFlag,0) = 0 "; // AND ISNULL(b.IsRead,0) = 0
|
|
|
841
|
+ sql += " and b.ToUserId = " + userId + " and ISNULL(b.IsRead,0) = 0 ";
|
|
|
842
|
+ //查询(聊天记录)
|
|
|
843
|
+ string sql1 = "SELECT TOP " + top + " a.Id FROM dbo.T_Msg_Chat a RIGHT JOIN dbo.T_Msg_Chat_Map b ON b.ChatId = a.Id LEFT JOIN dbo.T_Sys_UserAccount c ON c.F_UserId = a.FromUserId WHERE " + sql + " ORDER BY a.CreateDate ASC";
|
|
|
844
|
+ dt = DbHelperSQL.Query(sql1).Tables[0];
|
|
|
845
|
+ recordCount = dt.Rows.Count;
|
|
|
846
|
+
|
|
|
847
|
+ var obj = new
|
|
|
848
|
+ {
|
|
|
849
|
+ rows = "",
|
|
|
850
|
+ total = recordCount
|
|
|
851
|
+ };
|
|
|
852
|
+ return Content(obj.ToJson());
|
|
|
853
|
+ }
|
|
|
854
|
+
|
|
|
855
|
+ /// <summary>
|
|
825
|
856
|
/// 即时通讯 - 获取最新通讯信息(单方查看)
|
|
826
|
857
|
/// </summary>
|
|
827
|
858
|
/// <param name="id"></param>
|