public HttpResponseMessage GetBrokeAccountByUserId(string userId = null)
        {
            if (string.IsNullOrEmpty(userId))
            {
                return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据错误!")));
            }

            var brokeaccountcon = new BrokeAccountSearchCondition
            {
                Brokers = _brokerService.GetBrokerByUserId(Convert.ToInt32(userId)),
                State   = 0
            };
            var PointDetailList = _brokeaccountService.GetBrokeAccountsByCondition(brokeaccountcon).Select(p => new
            {
                Id = p.Id,
                p.Balancenum,
                p.Type,
                p.Addtime
            }).ToList().Select(p => new
            {
                Id = p.Id,
                p.Balancenum,
                p.Type,
                Addtime = p.Addtime.ToString("yyyy-MM-dd")
            });

            return(PageHelper.toJson(new { List = PointDetailList, Condition = brokeaccountcon }));
        }
        public string GetBrokerAmount()
        {
            var user = (UserBase)_workContext.CurrentUser;

            if (user != null)
            {
                var broker = _brokerService.GetBrokerByUserId(user.Id);//获取当前经纪人
                if (broker != null)
                {
                    BrokeAccountSearchCondition broconditon = new BrokeAccountSearchCondition
                    {
                        Brokers = broker,
                        State   = 0
                    };
                    //BrokerWithdrawDetailSearchCondition browithdetailcon = new BrokerWithdrawDetailSearchCondition
                    //{
                    //    Brokers = broker,
                    //    Type = "1"

                    //};
                    //decimal AddMoneys = _brokeaccountService.GetBrokeAccountsByCondition(broconditon).Count() > 0 ? _brokeaccountService.GetBrokeAccountsByCondition(broconditon).Sum(o => o.Balancenum) : 0;//新增的金额总和
                    //decimal TxMoneys = _brokerwithdrawdetailService.GetBrokerWithdrawDetailsByCondition(browithdetailcon).Count() > 0 ? _brokerwithdrawdetailService.GetBrokerWithdrawDetailsByCondition(browithdetailcon).Sum(o => o.Withdrawnum) : 0;//提现的总金额
                    //return (AddMoneys - TxMoneys).ToString();

                    return(_brokeaccountService.GetBrokeAccountsByCondition(broconditon).Count() > 0 ? _brokeaccountService.GetBrokeAccountsByCondition(broconditon).Sum(o => o.Balancenum).ToString() : "0");//金额总和
                }
            }
            return("");
        }