public int Member_Order_Count(int member_id, string count_type) { int Order_Count = 0; if (member_id > 0) { QueryInfo Query = new QueryInfo(); Query.PageSize = 1; Query.CurrentPage = 1; Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_BuyerID", "=", member_id.ToString())); //Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.U_Orders_IsShow", "=", "0")); switch (count_type) { case "order_all": //待签收的订单 Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_Status", "=", "1")); Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_DeliveryStatus", "<", "2")); Query.ParamInfos.Add(new ParamInfo("AND(", "int", "OrdersInfo.Orders_PaymentStatus", "=", "1")); Query.ParamInfos.Add(new ParamInfo("OR", "int", "OrdersInfo.Orders_PaymentStatus", "=", "4")); Query.ParamInfos.Add(new ParamInfo("OR)", "int", "OrdersInfo.Orders_Payway", "=", "3")); break; case "order_unprocessed": //待付款的订单 Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_Status", "<", "3")); Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_Payway", "<>", "3")); Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_PaymentStatus", "=", "0")); break; case "order_processing": //待确认的订单 Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_Status", "=", "0")); break; case "order_success": //待评价的订单 Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersInfo.Orders_DeliveryStatus", "=", "2")); break; case "order_faiture": //交易失败的订单 Query.ParamInfos.Add(new ParamInfo("AND(", "int", "OrdersInfo.Orders_Status", "=", "3")); Query.ParamInfos.Add(new ParamInfo("or)", "int", "OrdersInfo.Orders_Status", "=", "4")); break; } PageInfo page = MyOrders.GetPageInfo(Query); if (page != null) { Order_Count = page.RecordCount; } } return(Order_Count); }