Ejemplo n.º 1
0
        /// <summary>
        /// 厨师信息
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseCookInfo> GetCookInfoPage(PageParamList <RequestCookInfo> pageParam)
        {
            IQueryable <CookInfo> queryable = Kily.Set <CookInfo>().OrderByDescending(t => t.CreateTime);

            if (!string.IsNullOrEmpty(pageParam.QueryParam.AreaTree))
            {
                queryable = queryable.Where(t => t.TypePath.Contains(pageParam.QueryParam.AreaTree));
            }
            if (UserInfo().AccountType == AccountEnum.Province)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Province));
            }
            if (UserInfo().AccountType == AccountEnum.City)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().City));
            }
            if (UserInfo().AccountType == AccountEnum.Area)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Area));
            }
            if (UserInfo().AccountType == AccountEnum.Village)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Town));
            }
            var data = queryable.Select(t => new ResponseCookInfo()
            {
                Id            = t.Id,
                TrueName      = t.TrueName,
                IdCardNo      = t.IdCardNo,
                AuditTypeName = AttrExtension.GetSingleDescription <DescriptionAttribute>(t.AuditType),
                TableName     = t.GetType().Name
            }).ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 检测订单是否过期
 /// </summary>
 /// <returns></returns>
 public async Task CheckOrderExpire()
 {
     Kily.Set <SystemOrder>().Where(t => t.ExpireTime > DateTime.Now).ToList().ForEach(t =>
     {
         t.IsExpire = true;
         UpdateField(t, "IsExpire");
     });
     await Task.CompletedTask;
 }