예제 #1
0
        /// <summary>
        /// 获取签到最长的用户
        /// </summary>
        protected void GetMaxSignDaysUser()
        {
            bool   _isRedis = IsRedis == "1";
            string result   = mRedis.GetMaxSignDaysUser(_isRedis);

            SignDaysUser = JsonService.DeSerializeObject <MaxSignDaysUser>(result);
        }
예제 #2
0
        //获取交易额数据
        protected List <InvestDayReport> GetInvestDayReport(int dayCount)
        {
            string result = string.Empty;
            //if (IsRedis == "1")
            //{
            //    result = mRedis.InvestDayReport("", true);
            //}
            List <InvestDayReport> list = new List <InvestDayReport>();

            if (result != null)
            {
                list = JsonService.DeSerializeObject <List <InvestDayReport> >(result);
            }
            if (string.IsNullOrEmpty(result) || list.Where(m => m.Date.Day == DateTime.Now.AddDays(-1).Day).Count() == 0 || DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:15:00"))
            {
                string sql = "select CONVERT(varchar(5),DayDate,110) as Date,Total as Amount from InvestDayReport(nolock) where DayDate >=dateadd(day,@dayCout,getdate()) AND DayDate<getdate()";
                Dapper.DynamicParameters param = new Dapper.DynamicParameters();
                param.Add("@dayCout", dayCount);
                list = TuanDai.DB.TuanDaiDB.Query <InvestDayReport>(TuanDai.WXApiWeb.TdConfig.ApplicationName, TuanDai.WXApiWeb.TdConfig.DBRead, sql, ref param);


                List <InvestDayReportModel> listDQ = WebSiteDataClient.GetInvestDayReport(System.Math.Abs(dayCount));//定期理财交易数据

                if (list.Any() && listDQ.Any())
                {
                    foreach (var item in list)
                    {
                        foreach (var itemDQ in listDQ)
                        {
                            if (item.Date == itemDQ.Date)
                            {
                                item.Amount += itemDQ.Amount;
                            }
                        }
                    }
                }
                if (IsRedis == "1" && list != null && list.Count > 0)
                {
                    mRedis.InvestDayReport(JsonService.SerializeObject <List <InvestDayReport> >(list), false);
                }
            }
            else
            {
                list = JsonService.DeSerializeObject <List <InvestDayReport> >(result);
            }
            return(list);
        }