public IEnumerable<dynamic> QueryPayAddressOrderInfo(string beOrderID)
        {
            SQLStringInfo _sqlInfo = new SQLStringInfo();
            _sqlInfo.ColumnSB.Append(",line.ID as LineID");

            return base.QueryPayAddressOrderInfo(beOrderID, _sqlInfo);
        }
        /// <summary>
        /// 首页 + 模块列表页面可用商品列表查询
        /// </summary>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <param name="moduleID"></param>
        /// <returns></returns>
        public IEnumerable<CommodityDiscountInfoCNa> CommodityInfoQueryByPage(int page, int size, string moduleID, string strSearch = "")
        {
            //Param
            object par = null;
            

            //SqlInfo
            SQLStringInfo _sqlInfo = new SQLStringInfo();

            //增加折扣相关列
            _sqlInfo.ColumnSB.Append(",DIS.StartTime,DIS.EndTime,DIS.PostType as DiscountPostType,DIS.IsEndCommodity,DIS.OpeDate as DiscountOpeDate,DIS.DiscountID");
            _sqlInfo.ColumnSB.Append(",DIS.DiscountValue,DIS.DiscountPrice,DIS.DiscountCount");

            //增加 WHERE + LIMIT 语句
            _sqlInfo.WhereSB.Append(" WHERE COMM.Flag=@Flag ");

            if (!string.IsNullOrEmpty(strSearch)) { _sqlInfo.WhereSB.Append(" AND COMM.Title LIKE @Search "); strSearch = string.Format("%{0}%", strSearch); }

            if (!string.IsNullOrEmpty(moduleID)) { _sqlInfo.WhereSB.Append(" AND MID=@MID "); par = new { Flag = 1, MID = int.Parse(moduleID), Search = strSearch }; }
            else { par = new { Flag = 1, Search = strSearch }; }

            //_sqlInfo.OrderBySB.AppendFormat(" LIMIT {0},{1}", (page - 1) * size, size);

            //Query
            string strSql = _sqlInfo.GetSQLString(CommodityRelevanceDiscountSQL());

            return base.Query<CommodityDiscountInfoCNa>(strSql, par);
        }
        /// <summary>
        /// 全部商品关联折扣表、分页查询
        /// </summary>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public IEnumerable<dynamic> CommodityRelevanceDiscountByPage(int page, int size)
        {
            //增加 LIMIT 语句
            SQLStringInfo _sqlInfo = new SQLStringInfo();
            _sqlInfo.OrderBySB.AppendFormat(" LIMIT {0},{1}", (page - 1) * size, size);

            string strSql = _sqlInfo.GetSQLString(CommodityRelevanceDiscountSQL());

            return base.Query(strSql);
        }
        /// <summary>
        /// 关键词搜索商品、分页查询
        /// </summary>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <param name="searchValue"></param>
        /// <returns></returns>
        public IEnumerable<dynamic> CommodityRelevanceDiscountBySearch(int page, int size, string searchValue)
        {
            //增加 WHERE + LIMIT 语句
            SQLStringInfo _sqlInfo = new SQLStringInfo();
            _sqlInfo.WhereSB.AppendFormat(" WHERE COMM.Title LIKE '%{0}%' ", searchValue);
            _sqlInfo.OrderBySB.AppendFormat(" LIMIT {0},{1}", (page - 1) * size, size);

            string strSql = _sqlInfo.GetSQLString(CommodityRelevanceDiscountSQL());

            return base.Query(strSql);
        }
        /// <summary>
        /// 该用户未付款订单列表
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public IEnumerable<dynamic> QueryAwaitPayListInfo(string userID)
        {
            //Init
            string strSql = QueryOrderListSQL("beorder");

            //对SQL进行二次加工
            SQLStringInfo _sqlInfo = new SQLStringInfo();
            _sqlInfo.WhereSB.Append(" AND beorder.OrderState = 1 ");

            //调用获取SQL
            strSql = _sqlInfo.GetSQLString(strSql);

            //执行
            var result = base.Query(strSql, new { UserID = userID });

            return result;
        }
        public IEnumerable<dynamic> CommodityDiscountItem(string discountID)
        {
            //Init
            SQLStringInfo _sqlInfo = new SQLStringInfo();
            _sqlInfo.ColumnSB.Append(" ,DIS.PostType,DIS.IsEndCommodity ");
            _sqlInfo.WhereSB.Append(" WHERE DiscountID = @DiscountID");
            _sqlInfo.OrderBySB.Append(",COMM.Title");

            //DAL
            CommodityDiscountInfoDAL discountDal = new CommodityDiscountInfoDAL();

            string strSql = _sqlInfo.GetSQLString(discountDal.CommodityDiscountListSQL());

            IEnumerable<dynamic> list = discountDal.Query(strSql, new { DiscountID = discountID });

            return list;
        }
        /// <summary>
        /// 限时折扣列表页面数据查询逻辑业务方法
        /// </summary>
        /// <param name="queryType"></param>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public Tuple<IEnumerable<dynamic>, string> CommodityDiscountListOpe(string queryType, int page, int size)
        {
            //Init
            SQLStringInfo _sqlInfo = new SQLStringInfo();

            //Query
            IEnumerable<dynamic> list = new CommodityDiscountInfoDAL().CommodityDiscountListOpe(_sqlInfo);

            //Result
            IEnumerable<dynamic> result = null;
            string strState = string.Empty;

            int startIndex = (page - 1) * size;

            switch (queryType)
            {
                case "1"://进行中
                    result = list.Where(x => DateTime.Compare(DateTime.Parse(x.StartTime.ToString()), DateTime.Now) <= 0 && DateTime.Compare(DateTime.Parse(x.EndTime.ToString()), DateTime.Now) >= 0);
                    strState = "进行中";
                    break;

                case "2"://未开始
                    result = list.Where(x => DateTime.Compare(DateTime.Parse(x.StartTime.ToString()), DateTime.Now) > 0);
                    strState = "未开始";
                    break;

                case "3"://已结束
                    result = list.Where(x => DateTime.Compare(DateTime.Parse(x.EndTime.ToString()), DateTime.Now) < 0);
                    strState = "已结束";
                    break;

                default:
                    result = list;
                    break;
            }

            result = result.Count() != 0 ? result.Skip(startIndex).Take(size) : null;

            return new Tuple<IEnumerable<dynamic>, string>(result, strState);
        }
        /// <summary>
        /// 该用户已付款订单,待发货 + 待收货 + 待确认订单列表
        /// Remark:LogisticsState = 0、1、2
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="logisticsState"></param>
        /// <returns></returns>
        public IEnumerable<dynamic> QueryAwaitLogisticsListInfo(string userID, int logisticsState)
        {
            //Init
            string strSql = QueryOrderListSQL("order");

            //对SQL进行二次加工
            SQLStringInfo _sqlInfo = new SQLStringInfo();
            _sqlInfo.ColumnSB.Append(" ,exp.ExpressNum,exp.ExpressCode ");
            _sqlInfo.RelationSB.Append(" LEFT JOIN wx_zzscorderexpress exp ON exp.OrderNum = beorder.OrderNum ");
            _sqlInfo.WhereSB.Append(" AND beorder.OrderState = 3 ");
            _sqlInfo.WhereSB.Append(" AND beorder.LogisticsState = @LogisticsState ");

            //调用获取SQL
            strSql = _sqlInfo.GetSQLString(strSql);

            //执行
            var result = base.Query(strSql, new { UserID = userID, LogisticsState = logisticsState });

            return result;
        }
        /// <summary>
        /// 限时折扣列表页面数据查询业务逻辑方法
        /// </summary>
        /// <param name="_sqlInfo"></param>
        /// <returns></returns>
        public IEnumerable<dynamic> CommodityDiscountListOpe(SQLStringInfo _sqlInfo)
        {
            string strSql = _sqlInfo.GetSQLString(CommodityDiscountListSQL());

            return base.Query(strSql);
        }
        /// <summary>
        /// 商品详情页面
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public IEnumerable<CommodityDiscountInfoCNa> CommodityInfoQueryOnce(string strWhere, object param = null)
        {
            //SqlInfo
            SQLStringInfo _sqlInfo = new SQLStringInfo();

            //增加折扣相关列
            _sqlInfo.ColumnSB.Append(",DIS.StartTime,DIS.EndTime,DIS.PostType as DiscountPostType,DIS.IsEndCommodity,DIS.OpeDate as DiscountOpeDate,DIS.DiscountID");
            _sqlInfo.ColumnSB.Append(",DIS.DiscountValue,DIS.DiscountPrice,DIS.DiscountCount");

            //增加 WHERE + LIMIT 语句
            _sqlInfo.WhereSB.AppendFormat(" WHERE {0} ", strWhere);

            //Query
            string strSql = _sqlInfo.GetSQLString(CommodityRelevanceDiscountSQL());

            return base.Query<CommodityDiscountInfoCNa>(strSql, param);
        }