/// <summary>
        ///     查询提现订单列表
        /// </summary>
        /// <param name="model">搜索实体对象</param>
        /// <returns></returns>
        /// <remarks>added by jimmy,2015-7-3</remarks>
        public JsonResult List(SearchZJ_WithdrawOrderModel model)
        {
            model.PagedSize = model.PagedSize == 0 ? 10 : model.PagedSize;
            var list = _zJ_WithdrawOrderService.Select(model);
            var data = new { rows = list.Data, total = list.Data.TotalCount };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 提现订单分布查询
        /// </summary>
        /// <param name="model">输入查询参数对象</param>
        /// <returns></returns>
        /// <remarks>added by jimmy,2015-7-20</remarks>

        public ResultModel Select(SearchZJ_WithdrawOrderModel model)
        {
            var     zJ_WithdrawOrder = _database.Db.ZJ_WithdrawOrder;
            var     user             = _database.Db.YH_User;
            dynamic u;

            #region 查询参数条件
            //查询参数条件
            var whereParam = new SimpleExpression(1, 1, SimpleExpressionType.Equal);
            //订单号
            if (!string.IsNullOrEmpty(model.OrderNO))
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.OrderNO.Like("%" + model.OrderNO + "%"), SimpleExpressionType.And);
            }
            //手机号码
            if (!string.IsNullOrEmpty(model.Phone))
            {
                whereParam = new SimpleExpression(whereParam, user.Phone.Like("%" + model.Phone + "%"), SimpleExpressionType.And);
            }
            //手机号码
            if (!string.IsNullOrEmpty(model.Email))
            {
                whereParam = new SimpleExpression(whereParam, user.Email.Like("%" + model.Email + "%"), SimpleExpressionType.And);
            }
            //用户真实姓名
            if (!string.IsNullOrEmpty(model.RealName))
            {
                whereParam = new SimpleExpression(whereParam, user.RealName.Like("%" + model.RealName + "%"), SimpleExpressionType.And);
            }
            //审核人
            if (!string.IsNullOrEmpty(model.Verifier))
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.Verifier.Like("%" + model.Verifier + "%"), SimpleExpressionType.And);
            }
            //打款人
            if (!string.IsNullOrEmpty(model.Remitter))
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.Remitter.Like("%" + model.Remitter + "%"), SimpleExpressionType.And);
            }
            //银行账号
            if (!string.IsNullOrEmpty(model.BankAccount))
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.BankAccount.Like("%" + model.BankAccount + "%"), SimpleExpressionType.And);
            }
            //开户支行
            if (!string.IsNullOrEmpty(model.BankSubbranch))
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.BankSubbranch.Like("%" + model.BankSubbranch + "%"), SimpleExpressionType.And);
            }
            //开户名
            if (!string.IsNullOrEmpty(model.BankUserName))
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.BankUserName.Like("%" + model.BankUserName + "%"), SimpleExpressionType.And);
            }
            //来源
            if (model.OrderSource != null)
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.OrderSource == model.OrderSource.Value, SimpleExpressionType.And);
            }
            //提现结果
            if (model.WithdrawResult != null)
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.WithdrawResult == model.WithdrawResult.Value, SimpleExpressionType.And);
            }
            //申请提现时间
            if (model.BeginPaymentDate != null)
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.WithdrawDT >= model.BeginPaymentDate, SimpleExpressionType.And);
            }
            if (model.EndPaymentDate != null)
            {
                whereParam = new SimpleExpression(whereParam, zJ_WithdrawOrder.WithdrawDT < Convert.ToDateTime(model.EndPaymentDate).AddDays(1), SimpleExpressionType.And);
            }
            #endregion

            var query = zJ_WithdrawOrder.All().
                        LeftJoin(user, out u).On(u.UserID == zJ_WithdrawOrder.UserID).
                        Select(
                zJ_WithdrawOrder.OrderNO,
                zJ_WithdrawOrder.UserID,
                zJ_WithdrawOrder.WithdrawAmount,
                zJ_WithdrawOrder.WithdrawCommission,
                zJ_WithdrawOrder.WithdrawDT,
                zJ_WithdrawOrder.Verifier,
                zJ_WithdrawOrder.VerifyDT,
                zJ_WithdrawOrder.Remitter,
                zJ_WithdrawOrder.RemittanceDT,
                zJ_WithdrawOrder.Remark,
                zJ_WithdrawOrder.WithdrawResult,
                zJ_WithdrawOrder.CreateDT,
                zJ_WithdrawOrder.BankAccount,
                zJ_WithdrawOrder.BankName,
                zJ_WithdrawOrder.BankSubbranch,
                zJ_WithdrawOrder.BankUserName,
                zJ_WithdrawOrder.IsDisplay,
                zJ_WithdrawOrder.OrderSource,
                u.Account,
                u.RealName,
                u.Phone,
                u.Email,
                u.NickName
                ).Where(whereParam).OrderBy(zJ_WithdrawOrder.WithdrawResult);


            var result = new ResultModel()
            {
                Data = new SimpleDataPagedList <ZJ_WithdrawOrderModel>(query,
                                                                       model.PagedIndex, model.PagedSize)
            };
            return(result);
        }