Ejemplo n.º 1
0
        public static List <WeixinClock> GetTargetMonthClockRecords(this PinhuaContext context, int year, int month)
        {
            var result = new List <WeixinClock>();
            var bret   = context.GetAttendanceTimeRange(year, month, out var earliest, out var latest);

            if (bret)
            {
                var records1 = from p in context.WeixinClock.AsNoTracking()
                               where p.Clocktime.Value.IsBetween(earliest, latest)
                               select p;
                var records2 = from p in context.Wx异常说明.AsNoTracking()
                               where p.时间.Value.IsBetween(earliest, latest) && p.是否处理 == 1
                               select new WeixinClock
                {
                    Clocktype = p.类型,
                    Clocktime = p.时间,
                    Name      = p.姓名,
                    Userid    = p.用户号,
                };
                result = records1.Union(records2).OrderBy(p => p.Clocktime).ToList();
            }
            return(result);
        }