Exemplo n.º 1
0
        public ActionResult Index()
        {
            var email = CookieHelper.Email;
            var user  = UserService.Query(email);

            ViewData["User"] = user;
            //站点信息
            var info = SettingCache.Cache.Get(SettingFlag.WebSiteInfo);

            ViewData["WebSiteInfo"] = FormatHelper.HtmlDecode(info);
            //推广链接
            var website = SettingCache.Cache.Get(SettingFlag.WebSiteUrl);
            var affurl  = $"{website}?aff={user.AffCode}";

            ViewData["AffUrl"] = affurl;
            var num = SettingCache.Cache.Get(SettingFlag.RebateNum);

            ViewData["RebateNum"] = num;
            //SS
            var ss = SSService.Query(user.Id);

            if (ss == null || !ss.status)
            {
                //新用户 或者 服务已到期的用户 ss信息应为空
                ss = new Model.SSDto();
            }
            ViewData["SS"] = ss;
            //公告信息
            var notices = NoticeService.GetList(6);

            ViewData["Notices"] = notices;
            return(View());
        }
        /// <summary>
        /// 公告通知
        /// </summary>
        public ActionResult Notice()
        {
            var list = NoticeService.GetList(20);

            ViewData["List"] = list;
            return(View());
        }
        public JsonResult GetList()
        {
            var offset = RequestHelper.GetInt("offset");
            var limit  = RequestHelper.GetInt("limit");
            var key    = RequestHelper.GetValue("search");
            int total;
            var list = NoticeService.GetList(offset, limit, out total, key);

            return(Json(new { rows = list, total = total }, JsonRequestBehavior.AllowGet));
        }