tangjiang 9 ماه پیش
والد
کامیت
585e0d52a0
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      src/Hotline.Repository.SqlSugar/CallCenter/TrCallRecordRepository.cs

+ 3 - 2
src/Hotline.Repository.SqlSugar/CallCenter/TrCallRecordRepository.cs

@@ -21,7 +21,7 @@ namespace Hotline.Repository.SqlSugar.CallCenter
         {
         }
 
-        public async Task<List<BiCallDto>?> GetQueryCalls(DateTime beginDate, DateTime endDate)
+        public async Task<List<BiCallDto>?> GetQueryCalls(DateTime beginDate, DateTime endDate, string? Line)
         {
             List<int> dts = new List<int>();
             for (int i = 0; i < 24; i++)
@@ -33,6 +33,7 @@ namespace Hotline.Repository.SqlSugar.CallCenter
 
             var list = Db.Queryable<TrCallRecord>()
                  .Where(p => p.CreatedTime >= beginDate && p.CreatedTime <= endDate && p.CallDirection == ECallDirection.In)
+                 .WhereIF(!string.IsNullOrEmpty(Line), p => p.Gateway == Line)
                .GroupBy(p => p.CreatedTime.Hour)
                .Select(p => new
                {
@@ -41,7 +42,7 @@ namespace Hotline.Repository.SqlSugar.CallCenter
                    Answered = SqlFunc.AggregateSum(SqlFunc.IIF(p.AnsweredTime != null, 1, 0)), //应答数
                    Hanguped = SqlFunc.AggregateSum(SqlFunc.IIF(p.AnsweredTime == null && p.EndBy != null && p.EndBy.Value == EEndBy.To, 1, 0)),//挂断数
                })
-              // .GroupBy(p => p.Hour)
+               // .GroupBy(p => p.Hour)
                .MergeTable();
 
             var listCall = await listHour.LeftJoin(list, (x, p) => x.ColumnName == p.Hour)