public ActionResult SearchResult(string keyword)
        {
#if !DEBUG
            if (string.IsNullOrEmpty(ViewBag.LillyId))
            {
                return(Redirect("/notauthed.html"));
            }
#endif

            var hotSearch = _searchKeywordService.GetSearchKeywordsByCategory();
            ViewBag.hotsearch = hotSearch;

            FaqInfoSearchResultView faqSearchResultViewModel = new FaqInfoSearchResultView()
            {
                Keyword = keyword
            };

            if (!string.IsNullOrWhiteSpace(keyword))
            {
                var faqList = SearchPrivate(AppId, keyword);
                faqSearchResultViewModel.List = faqList;
            }
            else
            {
                faqSearchResultViewModel.List = new List <FaqInfoView>();
            }

            return(View("../FaqInfo/SearchResult", faqSearchResultViewModel));
        }
Example #2
0
        public ActionResult CommonSearchResult(string keyword, int appid, string menuCode)
        {
#if !DEBUG
            if (string.IsNullOrEmpty(ViewBag.WeChatUserID))
            {
                return(Redirect("/notauthed.html"));
            }
#endif

            var hotSearch = _searchKeywordService.GetSearchKeywordsByCategory(appid, 14);
            ViewBag.hotsearch = hotSearch;
            ViewBag.appid     = appid;
            ViewBag.menucode  = menuCode;
            FaqInfoSearchResultView faqSearchResultViewModel = new FaqInfoSearchResultView()
            {
                Keyword = keyword
            };

            if (!string.IsNullOrWhiteSpace(keyword))
            {
                var faqList = SearchPrivate(AppId, keyword);
                faqSearchResultViewModel.List = faqList;
            }
            else
            {
                faqSearchResultViewModel.List = new List <FaqInfoView>();
            }

            return(View("../FaqInfo/CommonSearchResult", faqSearchResultViewModel));
        }