Ejemplo n.º 1
0
        public ActionResult GetClubGives(Dictionary <string, string> queryvalues)
        {
            int uid = queryvalues.ContainsKey("clubid") ? (string.IsNullOrEmpty(queryvalues["clubid"]) ? -1 : Convert.ToInt32(queryvalues["clubid"])) : -1;
            //uid = 10701;
            IEnumerable <ClubGive> clubGives = ClubBLL.GetClubGive(uid);
            List <ClubGive>        resclubGives;

            if (clubGives == null)
            {
                resclubGives = null;
            }
            else
            {
                resclubGives = new List <ClubGive>();
                foreach (var item in clubGives)
                {
                    ClubGive give = new ClubGive()
                    {
                        CreateTime = item.CreateTime.Replace("0:00:00", "").Replace("/", "-"),
                        Gold       = item.Gold,
                        GoldStr    = item.Gold.ToString("#,0.")
                    };
                    resclubGives.Add(give);
                }
            }



            //查询本周总贡献总额
            Int64  weekTotal = ClubBLL.GetClubWeekTotal(uid);
            string fanli     = "20";
            string nextTotal = "";
            string nextFanLi = "";

            if (weekTotal < 500000000)
            {
                fanli     = "25"; //当前返利
                nextTotal = "5";  //下个返利服务费
                nextFanLi = "30"; //下个返利比例
            }
            else if (weekTotal < 1000000000)
            {
                fanli     = "30";
                nextTotal = "10";
                nextFanLi = "35";
            }
            else if (weekTotal < 1500000000)
            {
                fanli     = "35";
                nextTotal = "15";
                nextFanLi = "40";
            }
            else if (weekTotal < 2000000000)
            {
                fanli     = "40";
                nextTotal = "20";
                nextFanLi = "45";
            }
            else if (weekTotal < 3000000000)
            {
                fanli     = "45";
                nextTotal = "30";
                nextFanLi = "50";
            }
            else
            {
                fanli = "50";
            }

            //if (weekTotal < 500000000)
            //{
            //    fanli = "20";
            //    nextTotal = "5";
            //    nextFanLi = "25";
            //}
            //else if (weekTotal < 1000000000)
            //{
            //    fanli = "25";
            //    nextTotal = "10";
            //    nextFanLi = "30";
            //}
            //else if (weekTotal < 3000000000)
            //{
            //    fanli = "30";
            //    nextTotal = "30";
            //    nextFanLi = "40";
            //}
            //else if (weekTotal < 5000000000)
            //{
            //    fanli = "40";
            //    nextTotal = "50";
            //    nextFanLi = "50";
            //}
            //else
            //{
            //    fanli = "50";
            //}



            return(Json(new {
                data = resclubGives,
                WeekTotal = weekTotal.ToString("#,0."),
                FanLi = fanli,
                NextTotal = nextTotal,
                NextFanLi = nextFanLi
            }));
        }