예제 #1
0
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="SeachKey">查询关键词</param>
        public JsonResult Friend_SeachUserInfoList(string SeachKey)
        {
            try
            {
                var obj = oFriendsBLL.Friend_SeachUserInfoList(GetUserInfo().Id, SeachKey);
                List <SessionUserInfo> models = Common.CacheHelper <List <SessionUserInfo> > .GetCache("OnLineUsers");

                ReturnModel <List <SeachUserInfo> > remodel = JsonConvert.DeserializeObject <ReturnModel <List <SeachUserInfo> > >(obj.ToString());
                foreach (SeachUserInfo model in remodel.Data)
                {
                    model.IsOnline = 0;
                    if (models != null && models.Count(x => x.Id == model.Id) > 0)
                    {
                        model.IsOnline = 1;
                    }
                }
                return(Json(remodel));
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
        }