/// <summary> /// 获得已完成的订单 /// </summary> /// <returns></returns> public ActionResult Completed() { List <OrderModel> orderModelList = new List <OrderModel>(); IEnumerable <Order> orderList = _orderBLL.GetCompletedOrders(); foreach (var item in orderList) { OrderModel om = new OrderModel(item); Member member = _memberBLL.GetMemberById(item.MemberId); om.MemberName = member.NickeName; Address address = _addressBLL.GetAddressById(om.AddressId); om.Phone = address.Phone; om.Address = address.Province + "," + address.City + "," + address.County + "," + address.Detail; om.Consignee = address.Consignee; // 添加配送状态 om.LogisticalStatus = _orderStatusBLL.GetOrderStatusByOrderId(om.Id).Status; orderModelList.Add(om); } ViewData["CompletedOrderList"] = orderModelList; return(View()); }