/// <summary> /// 我的购物车购物车数据 /// </summary> public List <OrdersDetailExtend> OrderCartList() { try { var list = from c in _infoOrderDal.GetList().ToList() join b in _infoDetailDal.GetList().ToList() on c.OrdersId equals b.OrdersId join u in _infoProductDal.GetList().ToList() on b.ProductId equals u.ProductId select new OrdersDetailExtend { //订单 OrdersId = c.OrdersId, ProductId = b.ProductId, Orderdate = c.Orderdate, UserId = c.UserId, Title = u.Title, Price = u.Price, Total = c.Total, DeliveryDate = c.DeliveryDate, States = c.States, Remark = c.Remark, //订单详情 Path = _infoPhotoDal.GetList().Where(y => y.ProductId == (b.ProductId == null ? "" : b.ProductId)).FirstOrDefault().PhotoUrl ?? "", DetailId = b.DetailId, Quantity = b.Quantity, DetailStates = b.States, }; return(list.ToList());// ?? new List<OrdersDetailExtend> { }; } catch (Exception e) { throw; } }
/// <summary> /// 获取收藏商品 /// </summary> public List <ProductEx> FavoriteProductList(List <string> productId) { try { var prolist = _infoProductDal.GetList().Where(y => productId.Contains(y.ProductId)).ToList(); var ex = from c in prolist join b in _infoPhotoDal.GetList().ToList() on c.ProductId equals b.ProductId select new ProductEx { Content = c.Content, CateId = c.CateId, MarketPrice = c.MarketPrice, Path = b.PhotoUrl == null ? "" : b.PhotoUrl, Price = c.Price, ProductId = c.ProductId, Title = c.Title, Stock = c.Stock }; return(ex.ToList()); } catch { return(null); } }
public List <Photo> GetList() { return(_infoDal.GetList()); }