예제 #1
0
        public ActionResult Remind()
        {
            try
            {
                var user = GetUserData();

                Dictionary <string, object> data = new Dictionary <string, object>();

                //我的留言未读数量
                data["messageCount"] = ArticleLogic.GetNotReadMessageCount(user.UserId, 2);
                //我的消息-发送消息未读数量
                data["messagePushCount"] = ArticleLogic.GetNotReadMessageCount(user.UserId, 0);
                //我的消息-接收消息未读数量
                data["messagePullCount"] = ArticleLogic.GetNotReadMessageCount(user.UserId, 1);

                bool isbusiness = false;
                if (user.UserIdentity == 1)
                {
                    //客户数量
                    int customerAmount = CustomerLogic.GetCustomerCount(user.UserId, user.UserIdentity, 0);
                    //兑换数量
                    int exchangeAmount = UserLogic.GetConvertCount(user.UserId, 0);

                    int allyApplyAmount = UserLogic.AllyApplyCount(user.UserId);
                    if (customerAmount > 0 || exchangeAmount > 0 || allyApplyAmount > 0)
                    {
                        isbusiness = true;
                    }
                }
                data["businessRemind"] = isbusiness;
                return(Json(new ResultModel(ApiStatusCode.OK, data)));
            }
            catch (Exception ex)
            {
                LogHelper.Log(string.Format("Remind user:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR);
                return(Json(new ResultModel(ApiStatusCode.SERVICEERROR)));
            }
        }