예제 #1
0
        public ActionResult GetMember(Dictionary <string, string> queryvalues)
        {
            int      clubid  = queryvalues.ContainsKey("clubid") ? Convert.ToInt32(queryvalues["clubid"]) : -1;
            int      type    = queryvalues.ContainsKey("type") ? Convert.ToInt32(queryvalues["type"]) : -1;
            int      curTime = queryvalues.ContainsKey("curTime") ? Convert.ToInt32(queryvalues["curTime"]) : 0;
            int      page    = queryvalues.ContainsKey("page") ? Convert.ToInt32(queryvalues["page"]) : 1;
            string   preID   = queryvalues.ContainsKey("preID") ? Convert.ToString(queryvalues["preID"]) : "";
            DateTime time    = DateTime.Now.AddDays(curTime * -1);

            time = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0);
            //clubid = 10701;
            type = 2;

            int mycount     = ClubBLL.GetClubUserCount(clubid);
            int actioncount = 0;

            if (type == 1)
            {
                actioncount = ClubBLL.GetCommonClubCount(clubid);
            }
            else
            {
                actioncount = ClubBLL.GetHYClubCount(clubid);
            }
            //获取数据
            IEnumerable <MemberMender> data    = ClubBLL.GetMemberMender(clubid, time, page);
            List <MemberMender>        resData = new List <MemberMender>();

            foreach (var item in data)
            {
                MemberMender mem = new MemberMender();
                mem.Gold     = item.Gold;
                mem.GoldStr  = item.Gold.ToString("#,0.");
                mem.NickName = item.NickName;
                mem.ID       = item.ID;

                if (item.LastLogin <= 0)
                {
                    mem.BeforeLogin = "******";
                }
                else if (item.LastLogin < 30)
                {
                    mem.BeforeLogin = item.LastLogin + "天前";
                }
                else if (item.LastLogin < 3 * 30)
                {
                    mem.BeforeLogin = Convert.ToInt32(item.LastLogin / 30) + "个月前";
                }
                else
                {
                    mem.BeforeLogin = "******";
                }
                resData.Add(mem);
            }

            return(Json(new {
                mycount = mycount,
                actioncount = actioncount,
                data = resData,
                time = time.ToString("yyyy-MM-dd")
            }));
        }