var body = _db.tbl_worklist.AsQueryable();

            WorkOrderHomePageResponse model = new WorkOrderHomePageResponse();

            DateTime startDate = DateTime.Parse(DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd 00:00:00"));
            DateTime endDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));

            body = body.Where(w => w.Createtime >= startDate && w.Createtime <= endDate);

            var submitList = from o in body
                             orderby o.Createtime ascending
                             group o by new { time = new { o.Createtime.Year, o.Createtime.Month, o.Createtime.Day } } into g
                             select new SubmitModel
                             {
                                 Count = g.Count(),
                                 InDate = g.Key.time.Year+"-"+ g.Key.time.Month+"-"+g.Key.time.Day
                             };

            model.submit = submitList.ToList();

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2021-08-02
  • 2022-01-26
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案