Ejemplo n.º 1
0
        /// <summary>
        /// 获取用户收藏帖子列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetListMyFavoriteMsg()
        {
            returnObj = new Return_Msg_APP();
            string appId     = Utility.IO.Context.GetRequest("appId", string.Empty);
            int    userId    = Utility.IO.Context.GetRequestInt("userId", 0);
            int    pageSize  = Utility.IO.Context.GetRequestInt("pageSize", 10);
            int    pageIndex = Utility.IO.Context.GetRequestInt("pageIndex", 1);

            if (string.IsNullOrEmpty(appId) || userId <= 0)
            {
                returnObj.code = "200";
                returnObj.Msg  = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.code = "200";
                returnObj.Msg  = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            int            totalCount = 0;
            List <PlatMsg> list       = PlatUserFavoriteMsgBLL.SingleModel.GetListMyFavoriteMsg(r.Id, userId, out totalCount, pageSize, pageIndex);

            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            returnObj.dataObj = new { totalCount = totalCount, list = list.OrderByDescending(x => x.FavoriteId) };
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 商品一物一码
        /// </summary>
        /// <returns></returns>
        public ActionResult GetGoodsCodeUrl(int goodsId = 0, int type = 0, string pageUrl = "")
        {
            returnObj = new Return_Msg_APP();
            if (goodsId <= 0)
            {
                returnObj.Msg = "无效商品ID";
                return(Json(returnObj));
            }

            string msg = "";

            if (string.IsNullOrEmpty(pageUrl))
            {
                pageUrl = "pages/selected/goods-details/index";
            }

            //商品二维码
            returnObj.dataObj = PlatChildGoodsBLL.SingleModel.GetGoodsCodeUrl(goodsId, pageUrl, type, ref msg);
            if (msg.Length > 0)
            {
                returnObj.Msg = msg;
                return(Json(returnObj));
            }

            returnObj.isok = true;
            return(Json(returnObj));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 检测名片是否被禁用
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public ActionResult CheckCardState(int userId = 0)
        {
            returnObj = new Return_Msg_APP();
            if (userId <= 0)
            {
                returnObj.Msg = "无效的用户参数";
                return(Json(returnObj));
            }

            PlatMyCard model = PlatMyCardBLL.SingleModel.GetModelByUserId(userId);

            if (model == null)
            {
                returnObj.isok = true;
                returnObj.Msg  = "无效的名片";
                returnObj.isok = true;
                return(Json(returnObj));
            }
            if (model.State == -1)
            {
                returnObj.Msg     = "该名片信息违反平台规则,已被删除";
                returnObj.dataObj = false;
                return(Json(returnObj));
            }

            returnObj.isok    = true;
            returnObj.dataObj = true;
            return(Json(returnObj));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取发帖规则列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetRuleList()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId     = Utility.IO.Context.GetRequest("appId", string.Empty);
            int    pageSize  = Utility.IO.Context.GetRequestInt("pageSize", 10);
            int    pageIndex = Utility.IO.Context.GetRequestInt("pageIndex", 1);

            if (string.IsNullOrEmpty(appId))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            int totalCount          = 0;
            List <PlatMsgRule> list = PlatMsgRuleBLL.SingleModel.GetListByaid(r.Id, out totalCount, pageSize, pageIndex);

            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            returnObj.dataObj = new { totalCount = totalCount, list = list };
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public ActionResult GetStoreGoods()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId = Context.GetRequest("appId", string.Empty);

            if (string.IsNullOrEmpty(appId))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            int    pageIndex        = Context.GetRequestInt("pageIndex", 1);
            int    pageSize         = Context.GetRequestInt("pageSize", 10);
            int    isFirstType      = Context.GetRequestInt("isFirstType", 1);
            int    categoryId       = Context.GetRequestInt("categoryId", 0);
            string goodsName        = Utility.IO.Context.GetRequest("goodsName", string.Empty);
            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            int totalCount = 0;
            List <PlatChildGoods> listGoods = PlatStoreBLL.SingleModel.GetSyncGoods(r.Id, out totalCount, string.Empty, goodsName, 1, string.Empty, pageSize, pageIndex, isFirstType, categoryId, appId: r.AppId);

            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            returnObj.dataObj = new { totalCount = totalCount, list = listGoods };
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 平台上获取订单信息列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetPlatOrderList()
        {
            returnObj = new Return_Msg_APP();
            int userId    = Context.GetRequestInt("userid", 0);
            int state     = Context.GetRequestInt("state", 0);
            int pageIndex = Context.GetRequestInt("pageindex", 1);
            int pageSize  = Context.GetRequestInt("pagesize", 10);

            if (userId <= 0)
            {
                returnObj.Msg = "用户ID不能为0";
                return(Json(returnObj));
            }
            C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetModel(userId);

            if (userInfo == null)
            {
                returnObj.Msg = "找不到用户";
                return(Json(returnObj));
            }

            XcxAppAccountRelation xcxrelation = _xcxAppAccountRelationBLL.GetModelByAppid(userInfo.appId);

            if (xcxrelation == null)
            {
                returnObj.Msg = "无效模板";
                return(Json(returnObj));
            }

            string           userIds   = userId.ToString();
            List <PlatStore> storeList = PlatStoreBLL.SingleModel.GetXcxRelationAppids(xcxrelation.Id);

            if (storeList != null && storeList.Count > 0)
            {
                string            appids       = "'" + string.Join("','", storeList.Select(s => s.AppId)) + "'";
                List <C_UserInfo> userInfoList = C_UserInfoBLL.SingleModel.GetListByAppIds(userInfo.TelePhone, appids);
                if (userInfoList != null && userInfoList.Count > 0)
                {
                    userIds += "," + string.Join(",", userInfoList.Select(s => s.Id));
                }
            }

            int count = 0;
            List <PlatChildGoodsOrder> list = PlatChildGoodsOrderBLL.SingleModel.GetList_Api(state, 0, 0, pageSize, pageIndex, ref count, 0, 0, 0, userIds);

            if (count > 0)
            {
                string           storeIds  = string.Join(",", list.Select(s => s.StoreId).Distinct());
                List <PlatStore> allStores = PlatStoreBLL.SingleModel.GetListByIds(storeIds);
                foreach (PlatChildGoodsOrder item in list)
                {
                    PlatStore storeModel = allStores?.FirstOrDefault(f => f.Id == item.StoreId);
                    item.StoreName = storeModel?.Name;
                }
            }

            returnObj.isok    = true;
            returnObj.dataObj = new { count = count, list = list };
            return(Json(returnObj));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取平台店铺类别配置
        /// </summary>
        /// <returns></returns>
        public ActionResult GetStoreCategoryLevel()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId = Context.GetRequest("appId", string.Empty);

            if (string.IsNullOrEmpty(appId))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }


            returnObj.dataObj = PlatStoreCategoryConfigBLL.SingleModel.GetModelByAid(r.Id);
            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public ActionResult getCityUserMsgList()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId     = Context.GetRequest("appId", string.Empty);
            int    userId    = Context.GetRequestInt("userId", 0);
            int    pageSize  = Context.GetRequestInt("pageSize", 10);
            int    pageIndex = Context.GetRequestInt("pageIndex", 1);

            if (string.IsNullOrEmpty(appId) || userId <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            int totalCount          = 0;
            List <CityUserMsg> list = CityUserMsgBLL.SingleModel.getListByUserId(r.Id, userId, out totalCount, pageSize, pageIndex, appId);

            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            returnObj.dataObj = new { totalCount = totalCount, list = list };
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 发送验证码修改密码
        /// </summary>
        /// <returns></returns>
        public ActionResult GetVaildCode()
        {
            Return_Msg_APP result   = new Return_Msg_APP();
            string         phoneNum = Context.GetRequest("phonenum", "");
            //修改密码 type=0  注册type=1
            int type = Context.GetRequestInt("type", 0);

            Account account = AccountBLL.SingleModel.GetModelByPhone(phoneNum);

            //代理分销,判断是否已开通过代理,开通过代理就不给他开通
            int agentqrcodeid = Context.GetRequestInt("agentqrcodeid", 0);

            if (agentqrcodeid > 0 && account != null)
            {
                Agentinfo agentmodel = AgentinfoBLL.SingleModel.GetModelByAccoundId(account.Id.ToString());
                if (agentmodel != null)
                {
                    result.Msg = "该手机号已经绑定了代理商账号";
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }

            Return_Msg _msg = CommondHelper.GetVaildCode(agentqrcodeid, phoneNum, account, type);

            result.isok    = _msg.isok;
            result.Msg     = _msg.Msg;
            result.code    = _msg.code;
            result.dataObj = _msg.dataObj;
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 10
0
        public ActionResult getUnReadUserMsgCount()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId  = Context.GetRequest("appId", string.Empty);
            int    userId = Context.GetRequestInt("userId", 0);

            if (string.IsNullOrEmpty(appId) || userId <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            int count = CityUserMsgBLL.SingleModel.GetCountByUserId(r.Id, userId, 0);

            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            returnObj.dataObj = new { count = count };
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 获取订单信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrderInfo()
        {
            returnObj = new Return_Msg_APP();
            int userId = Context.GetRequestInt("userid", 0);
            int id     = Context.GetRequestInt("id", 0);

            if (userId <= 0)
            {
                returnObj.Msg = "用户ID不能为0";
                return(Json(returnObj));
            }

            PlatChildGoodsOrder model = PlatChildGoodsOrderBLL.SingleModel.GetModel_Api(id);

            if (model != null)
            {
                PlatStore store = PlatStoreBLL.SingleModel.GetModel(model.StoreId);
                if (store != null)
                {
                    model.StorePhone = store.Phone;
                }
                model.DeliveryInfo = DeliveryFeedbackBLL.SingleModel.GetOrderFeed(orderId: model.Id, orderType: DeliveryOrderType.独立小程序订单商家发货);
            }

            returnObj.dataObj = model;
            returnObj.isok    = true;
            return(Json(returnObj));
        }
Ejemplo n.º 12
0
        public ActionResult GetCityStoreUserPhone()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId  = Context.GetRequest("appId", string.Empty);
            int    userId = Context.GetRequestInt("userId", 0);

            if (string.IsNullOrEmpty(appId) || userId <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj));
            }
            CityStoreUser model = CityStoreUserBLL.SingleModel.getCity_StoreUser(r.Id, userId);
            string        phone = string.Empty;

            if (model != null)
            {
                phone = model.phone;
            }
            returnObj.isok    = true;
            returnObj.Msg     = "操作成功";
            returnObj.dataObj = new { phone = phone };
            return(Json(returnObj));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 获取评论
        /// </summary>
        /// <returns></returns>
        public ActionResult GetMsgComment()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId      = Context.GetRequest("appId", string.Empty);
            int    Id         = Context.GetRequestInt("Id", 0);         //指定某条帖子的 评论
            int    userId     = Context.GetRequestInt("userId", 0);     //指定用户Id 表示获取我发出去的评论
            int    actionType = Context.GetRequestInt("actionType", 0); //默认为0 0:帖子,1:商品,2:评论(PointsDataType)
            int    pageSize   = Context.GetRequestInt("pageSize", 10);
            int    pageIndex  = Context.GetRequestInt("pageIndex", 1);
            string keyMsg     = Context.GetRequest("keyMsg", string.Empty);

            if (string.IsNullOrEmpty(appId))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            int totalCount = 0;
            List <PlatMsgComment> listComment = PlatMsgCommentBLL.SingleModel.GetPlatMsgComment(r.Id, out totalCount, actionType, keyMsg, pageSize, pageIndex, Id, userId);

            returnObj.dataObj = new { totalCount = totalCount, list = listComment };
            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 获取商家审核设置模式 小程序发帖时请求
        /// </summary>
        /// <returns></returns>

        public ActionResult GetCityReviewSetting()
        {
            returnObj = new Return_Msg_APP();
            string appId = Context.GetRequest("appId", string.Empty);

            if (string.IsNullOrEmpty(appId))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            PlatMsgConf platMsgConf = PlatMsgConfBLL.SingleModel.GetMsgConf(r.Id);

            if (platMsgConf == null)
            {
                returnObj.Msg = "审核配置异常";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            returnObj.isok    = true;
            returnObj.dataObj = new { obj = platMsgConf };

            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 获取店铺列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetStoreList(double lat = 0.00, double lng = 0.00)
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId = Context.GetRequest("appId", string.Empty);

            if (string.IsNullOrEmpty(appId))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }


            string keyMsg     = Utility.IO.Context.GetRequest("keyMsg", string.Empty);
            int    orderType  = Utility.IO.Context.GetRequestInt("orderType", 0);  //默认为0  1表示按照距离由近到远 2表示默认按照时间降序
            int    categoryId = Utility.IO.Context.GetRequestInt("categoryId", 0); //默认为0 表示获取所有 其它表示获取某个类别
            int    pageSize   = Utility.IO.Context.GetRequestInt("pageSize", 10);
            int    pageIndex  = Utility.IO.Context.GetRequestInt("pageIndex", 1);

            int isBigType = Utility.IO.Context.GetRequestInt("isBigType", 0); //点击的是否为大类,如果为1则表示点击大类获取其下的小类
            int cityCode  = Utility.IO.Context.GetRequestInt("cityCode", 0);  //哪个地区 默认为0 获取全部地区



            //表示按照距离最近的
            //表示没有传坐标 通过客户端IP获取经纬度

            if (lat == 0 || lng == 0)
            {
                string IP = Utility.WebHelper.GetIP();

                IPToPoint iPToPoint = CommondHelper.GetLoctionByIP(IP);
                if (iPToPoint != null)
                {
                    lat = iPToPoint.result.location.lat;
                    lng = iPToPoint.result.location.lng;
                    //log4net.LogHelper.WriteInfo(this.GetType(), $"IP={IP};{lat},{lng}");
                }
            }



            int totalCount        = 0;
            List <PlatStore> list = PlatStoreBLL.SingleModel.GetListStore(r.Id, out totalCount, categoryId, keyMsg, lat, lng, cityCode, orderType, pageSize, pageIndex, isBigType, r.AppId);

            returnObj.dataObj = new { totalCount = totalCount, list = list };
            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 获取订单信息列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrderList()
        {
            returnObj = new Return_Msg_APP();
            int userId    = Context.GetRequestInt("userid", 0);
            int state     = Context.GetRequestInt("state", 0);
            int pageIndex = Context.GetRequestInt("pageindex", 1);
            int pageSize  = Context.GetRequestInt("pagesize", 10);

            if (userId <= 0)
            {
                returnObj.Msg = "用户ID不能为0";
                return(Json(returnObj));
            }
            C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetModel(userId);

            if (userInfo == null)
            {
                returnObj.Msg = "找不到用户";
                return(Json(returnObj));
            }

            XcxAppAccountRelation xcxrelation = _xcxAppAccountRelationBLL.GetModelByAppid(userInfo.appId);

            if (xcxrelation == null)
            {
                returnObj.Msg = "无效模板";
                return(Json(returnObj));
            }

            PlatStore store = PlatStoreBLL.SingleModel.GetModelByAId(xcxrelation.Id);

            if (store == null)
            {
                returnObj.Msg = "无效店铺";
                return(Json(returnObj));
            }

            int platUserId = 0;
            XcxAppAccountRelation platXcxRelation = _xcxAppAccountRelationBLL.GetModel(store.BindPlatAid);

            if (platXcxRelation != null)
            {
                //平台上的用户ID
                List <C_UserInfo> userInfoList = C_UserInfoBLL.SingleModel.GetListByAppIds(userInfo.TelePhone, $"'{platXcxRelation.AppId}'");
                if (userInfoList != null && userInfoList.Count > 0)
                {
                    platUserId = userInfoList[0].Id;
                }
            }

            int count = 0;
            List <PlatChildGoodsOrder> list = PlatChildGoodsOrderBLL.SingleModel.GetList_Api(state, xcxrelation.Id, userId, pageSize, pageIndex, ref count, store.Id, store.BindPlatAid, platUserId);

            returnObj.isok    = true;
            returnObj.dataObj = new { count = count, list = list };
            return(Json(returnObj));
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetUserInfo()
        {
            returnObj = new Return_Msg_APP();
            string appId    = Context.GetRequest("appid", string.Empty);
            int    userId   = Context.GetRequestInt("userId", 0);
            int    userType = Context.GetRequestInt("userType", 0);//0 普通用户 1足浴技师  2商家

            if (string.IsNullOrEmpty(appId) || userId <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }
            XcxAppAccountRelation xcxRelatrion = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (xcxRelatrion == null)
            {
                returnObj.Msg = "小程序不存在";
                return(Json(returnObj));
            }
            //Store storeInfo = _storeBll.GetModelByRid(xcxRelatrion.Id);
            //if (storeInfo == null)
            //{
            //    result.Msg = "门店信息错误";
            //    return Json(result);
            //}
            //try
            //{

            //    storeInfo.funJoinModel = JsonConvert.DeserializeObject<StoreConfigModel>(storeInfo.configJson) ?? new StoreConfigModel();//若为 null 则new一个新的配置
            //}
            //catch
            //{
            //    storeInfo.funJoinModel = new StoreConfigModel();
            //}
            if (userType == 0)//普通用户
            {
                C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetModelByAppId_UserId(appId, userId);
                if (userInfo != null)
                {
                    returnObj.isok    = true;
                    returnObj.dataObj = userInfo;
                    // result.Msg = storeInfo.funJoinModel.helloWords;
                }
                else
                {
                    returnObj.Msg = "用户不存在";
                }
            }
            else if (userType == 2)//商家
            {
                C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetKfInfo(xcxRelatrion.AppId);
                returnObj.isok    = true;
                returnObj.dataObj = userInfo;
            }
            return(Json(returnObj));
        }
Ejemplo n.º 18
0
        public ActionResult GetPayLogList()
        {
            returnObj = new Return_Msg_APP();
            string appid     = Context.GetRequest("appid", string.Empty);
            string openid    = Context.GetRequest("openid", string.Empty);
            int    pageIndex = Context.GetRequestInt("pageIndex", 1);
            int    pageSize  = Context.GetRequestInt("pageSize", 10);

            if (string.IsNullOrEmpty(appid))
            {
                returnObj.Msg = "获取失败(appid不能为空)";
                return(Json(returnObj));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appid);

            if (r == null)
            {
                returnObj.Msg = "获取失败(还未进行授权)";
                return(Json(returnObj));
            }
            C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetModelByAppId_OpenId(appid, openid);

            if (userInfo == null)
            {
                returnObj.Msg = "用户不存在";
                return(Json(returnObj));
            }

            List <SaveMoneySetUserLog> list = SaveMoneySetUserLogBLL.SingleModel.GetListByUserId(userInfo.Id, r.AppId, pageSize, pageIndex);

            list.ForEach(x =>
            {
                if (x.Type == 0)
                {
                    x.ChangeNote = "【充值】" + x.ChangeNote;
                }
                else if (x.Type == -1)
                {
                    x.ChangeNote = "【储值支付】" + x.ChangeNote;
                }
                else if (x.Type == -2)
                {
                    x.ChangeNote = "【微信支付】" + x.ChangeNote;
                }
                else if (x.Type == 1)
                {
                    x.ChangeNote = "【退款】" + x.ChangeNote;
                }
            });

            returnObj.Msg     = "获取预存款记录成功";
            returnObj.dataObj = list;
            returnObj.isok    = true;
            return(Json(returnObj));
        }
Ejemplo n.º 19
0
        public ActionResult HaveSixin(int tuserId = 0, int fuserId = 0)
        {
            Return_Msg_APP result = new Return_Msg_APP();

            //私信记录是否有发新消息
            PlatMyCardBLL.SingleModel.HaveSixin(tuserId, fuserId, true);
            result.isok = true;

            return(Json(result));
        }
Ejemplo n.º 20
0
        public ActionResult getMsgCode()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId  = Context.GetRequest("appId", string.Empty);
            string phone  = Context.GetRequest("phone", string.Empty);
            int    userId = Context.GetRequestInt("userId", 0);

            if (string.IsNullOrEmpty(appId) || userId <= 0 || string.IsNullOrEmpty(phone))
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }
            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            phone = phone.Trim();
            //校验手机号码
            if (!Regex.IsMatch(phone, @"\d") || phone.Length > 11)
            {
                returnObj.Msg = "请填写合法的手机号码";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            SendMsgHelper sendMsgHelper = new SendMsgHelper();
            string        codeKey       = string.Format(CITY_BINDPHONE, phone);
            string        authCode      = RedisUtil.Get <string>(codeKey);

            if (string.IsNullOrEmpty(authCode))
            {
                authCode = Utility.EncodeHelper.CreateRandomCode(4);//生成4位数验证码
            }
            bool senMsgCodeResult = sendMsgHelper.AliSend(phone, "{\"code\":\"" + authCode + "\",\"product\":\" " + Enum.GetName(typeof(SendTypeEnum), 8) + "\"}", "小未科技", 401);

            if (senMsgCodeResult)//表示发送成功
            {
                RedisUtil.Set <string>(codeKey, authCode, TimeSpan.FromMinutes(1));
                returnObj.dataObj = new { authCode = authCode };
                returnObj.isok    = true;
                returnObj.Msg     = "验证码发送成功!";
            }
            else
            {
                returnObj.Msg = "验证码发送失败,请稍后再试!";
            }

            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 人脉圈
        /// </summary>
        /// <returns></returns>
        public ActionResult GetConnectionsList()
        {
            returnObj = new Return_Msg_APP();
            int    userId     = Context.GetRequestInt("userid", 0);
            int    aid        = Context.GetRequestInt("aid", 0);
            int    distance   = Context.GetRequestInt("distance", -1);//-1默认,-2:同城,大于0:附近人
            int    actionType = Context.GetRequestInt("actiontype", -1);
            int    areaCode   = Context.GetRequestInt("areacode", 0);
            int    industryId = Context.GetRequestInt("industryid", 0);
            int    pageIndex  = Context.GetRequestInt("pageindex", 1);
            int    pageSize   = Context.GetRequestInt("pagesize", 10);
            string lng        = Context.GetRequest("lng", "0");
            string lat        = Context.GetRequest("lat", "0");

            if (userId <= 0)
            {
                returnObj.Msg = "userid不能小于0";
                return(Json(returnObj));
            }
            if (aid <= 0)
            {
                returnObj.Msg = "aid不能小于0";
                return(Json(returnObj));
            }

            C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetModel(userId);

            if (userInfo == null)
            {
                returnObj.Msg = "用户信息无效";
                return(Json(returnObj));
            }

            int cityCode = 0;
            int count    = 0;

            PlatMyCard myCard = PlatMyCardBLL.SingleModel.GetModelByUserId(userId, aid);

            if (myCard != null)
            {
                lng      = myCard.Lng.ToString();
                lat      = myCard.Lat.ToString();
                cityCode = myCard.CityCode;
            }
            lat = lat == "undefined" ? "0" : lat;
            lng = lng == "undefined" ? "0" : lng;

            List <PlatMyCard> list = PlatMyCardBLL.SingleModel.GetCardApiList(userInfo.appId, industryId, areaCode, lng, lat, cityCode, distance, userId, aid, actionType, ref count, pageSize, pageIndex);

            returnObj.dataObj = new { list = list, count = count };
            returnObj.isok    = true;
            return(Json(returnObj));
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 获取一条帖子的详情
        /// </summary>
        /// <returns></returns>
        public ActionResult GetMsgDetail()
        {
            returnObj = new Return_Msg_APP();
            string appId  = Utility.IO.Context.GetRequest("appId", string.Empty);
            int    msgId  = Utility.IO.Context.GetRequestInt("msgId", 0);  //帖子信息Id
            int    userId = Utility.IO.Context.GetRequestInt("userId", 0); // 类似用户Id

            if (string.IsNullOrEmpty(appId) || msgId <= 0)
            {
                returnObj.code = "200";
                returnObj.Msg  = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.code = "200";
                returnObj.Msg  = "小程序未授权";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }


            PlatMsg model = PlatMsgBLL.SingleModel.GetMsg(r.Id, msgId);

            if (model == null)
            {
                returnObj.code = "200";
                returnObj.Msg  = "找不到数据";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }



            PlatUserFavoriteMsg _userFavoriteMsg = PlatUserFavoriteMsgBLL.SingleModel.GetUserFavoriteMsg(r.Id, msgId, userId, (int)PointsActionType.收藏);

            model.IsFavorited = (_userFavoriteMsg != null && _userFavoriteMsg.State != -1);

            PlatUserFavoriteMsg _userFavoriteMsgDz = PlatUserFavoriteMsgBLL.SingleModel.GetUserFavoriteMsg(r.Id, msgId, userId, (int)PointsActionType.点赞);

            model.IsDzed = (_userFavoriteMsgDz != null && _userFavoriteMsgDz.State != -1);

            PlatMsgReport _platMsgReport = PlatMsgReportBLL.SingleModel.GetMsgReport(userId, msgId);

            model.IsReported = (_platMsgReport != null);

            returnObj.isok    = true;
            returnObj.Msg     = "获取成功";
            returnObj.dataObj = new { msg = model };
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 23
0
        public ActionResult GetDadaFreight()
        {
            #region 达达下单参数
            string cityname      = Context.GetRequest("cityname", string.Empty);
            string appid         = Context.GetRequest("appid", string.Empty);
            string openid        = Context.GetRequest("openid", string.Empty);
            string lat           = Context.GetRequest("lat", string.Empty);
            string lnt           = Context.GetRequest("lnt", string.Empty);
            string acceptername  = Context.GetRequest("acceptername", string.Empty);
            string accepterphone = Context.GetRequest("accepterphone", string.Empty);
            string address       = Context.GetRequest("address", string.Empty);
            #endregion
            string msg = "";
            returnObj = new Return_Msg_APP()
            {
                isok = false
            };
            int getway = (int)miniAppOrderGetWay.达达配送;

            XcxAppAccountRelation xcxrelation = _xcxAppAccountRelationBLL.GetModelByAppid(appid);
            if (xcxrelation == null)
            {
                returnObj.Msg = "请先授权 umodel_null";
                return(Json(returnObj));
            }

            int storeId = 0;
            int tmpType = _xcxAppAccountRelationBLL.GetXcxTemplateType(xcxrelation.Id);
            switch (tmpType)
            {
            case (int)TmpType.小程序专业模板: break;

            case (int)TmpType.小程序餐饮模板:
                Food food = FoodBLL.SingleModel.GetModelByAppId(xcxrelation.Id);
                if (food == null)
                {
                    returnObj.Msg = "找不到餐饮店铺";
                    return(Json(returnObj));
                }
                getway = food.DistributionWay;
                break;
            }

            ResultReponseModel result = new ResultReponseModel();
            result.deliverFeeInt = DistributionApiConfigBLL.SingleModel.Getpeisongfei(cityname, appid, openid, lat, lnt, acceptername, accepterphone, address, ref msg, getway, storeId, xcxrelation.Id, 0);
            result.deliverFee    = result.deliverFeeInt * 0.01;
            returnObj.isok       = !(msg.Length > 0);
            returnObj.Msg        = msg;
            returnObj.dataObj    = result;
            return(Json(returnObj));
        }
Ejemplo n.º 24
0
        public ActionResult SaveCityStoreUser()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId  = Context.GetRequest("appId", string.Empty);
            int    userId = Context.GetRequestInt("userId", 0);

            if (string.IsNullOrEmpty(appId) || userId <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj));
            }
            CityStoreUser model            = CityStoreUserBLL.SingleModel.getCity_StoreUser(r.Id, userId);
            int           city_storeUserId = 0;

            if (model == null)
            {
                //新增一条记录
                city_storeUserId = Convert.ToInt32(CityStoreUserBLL.SingleModel.Add(new CityStoreUser()
                {
                    aid        = r.Id,
                    userId     = userId,
                    addTime    = DateTime.Now,
                    updateTime = DateTime.Now,
                    state      = 0
                }));
                if (city_storeUserId <= 0)
                {
                    returnObj.Msg = "操作异常";
                    return(Json(returnObj));
                }
            }
            else
            {
                city_storeUserId = model.Id;
            }

            returnObj.isok    = true;
            returnObj.Msg     = "操作成功";
            returnObj.dataObj = new { id = city_storeUserId };
            return(Json(returnObj));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 获取流量广告配置
        /// </summary>
        /// <param name="aid"></param>
        /// <param name="configType"></param>
        /// <returns></returns>
        public ActionResult GetAdvertisementConfig(int aid = 0, int configType = 0)
        {
            returnObj = new Return_Msg_APP();
            if (configType < 0 || aid <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            List <PlatConfig> list = PlatConfigBLL.SingleModel.GetListByConfigType(aid, configType);

            returnObj.dataObj = list;
            returnObj.isok    = true;
            return(Json(returnObj));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 获取名片
        /// </summary>
        /// <returns></returns>
        public ActionResult GetMyCard()
        {
            returnObj = new Return_Msg_APP();
            int userId   = Context.GetRequestInt("userid", 0);
            int myuserId = Context.GetRequestInt("myuserid", 0);
            int aid      = Context.GetRequestInt("aid", 0);

            if (userId <= 0 || myuserId <= 0)
            {
                returnObj.Msg = "userid不能小于0";
                return(Json(returnObj));
            }
            if (aid <= 0)
            {
                returnObj.Msg = "aid不能小于0";
                return(Json(returnObj));
            }

            PlatMyCard platMyCardModel = PlatMyCardBLL.SingleModel.GetMyCardData(userId, myuserId, aid, (int)PointsDataType.片);

            if (platMyCardModel == null || platMyCardModel.Id <= 0)
            {
                returnObj.Msg     = "您还没有创建名片";
                returnObj.dataObj = platMyCardModel;
                return(Json(returnObj));
            }
            //判断是否已保存appid
            if (string.IsNullOrEmpty(platMyCardModel.AppId))
            {
                C_UserInfo userinfo = C_UserInfoBLL.SingleModel.GetModel(platMyCardModel.UserId);
                platMyCardModel.AppId = userinfo.appId;
                PlatMyCardBLL.SingleModel.Update(platMyCardModel, "appid");
            }

            bool isReload = false;

            //获取服务器商的图片路径
            platMyCardModel.ImgUrl = WxUploadHelper.GetMyServerImgUrl(platMyCardModel.ImgUrl, ref isReload);
            if (isReload)
            {
                PlatMyCardBLL.SingleModel.Update(platMyCardModel, "ImgUrl");
            }

            returnObj.dataObj = platMyCardModel;
            returnObj.isok    = platMyCardModel.Id > 0;
            returnObj.Msg     = returnObj.isok ? "成功" : "失败";
            return(Json(returnObj));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 根据城市名称获取百度天气
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public ActionResult GetBaiduWeather(string location)
        {
            returnObj = new Return_Msg_APP();
            if (string.IsNullOrEmpty(location))
            {
                returnObj.Msg = "请选择城市";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            string result = HttpHelper.GetData($"http://api.map.baidu.com/telematics/v3/weather?location={location}&output=json&ak={ConfigurationManager.AppSettings["BaiduAk"]}");

            returnObj.Msg     = "获取成功";
            returnObj.dataObj = result;
            returnObj.isok    = true;
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 删除我收藏的记录或者发布的帖子
        /// </summary>
        /// <returns></returns>
        public ActionResult DelMyFavoriteOrMyMsg()
        {
            returnObj      = new Return_Msg_APP();
            returnObj.code = "200";
            string appId   = Context.GetRequest("appId", string.Empty);
            int    userId  = Context.GetRequestInt("myCardId", 0);
            int    Id      = Context.GetRequestInt("Id", 0);
            int    delType = Context.GetRequestInt("delType", 0);//默认为0 表示删除我发布的帖子 1表示删除我收藏的帖子

            if (string.IsNullOrEmpty(appId) || userId <= 0 || Id <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj));
            }

            XcxAppAccountRelation r = _xcxAppAccountRelationBLL.GetModelByAppid(appId);

            if (r == null)
            {
                returnObj.Msg = "小程序未授权";
                return(Json(returnObj));
            }

            bool delresult = false;

            // log4net.LogHelper.WriteInfo(this.GetType(), "删除" + $"delType={delType} , userId={userId} , aid={appId},Id={Id}");
            if (delType == 0)
            {
                //删除我发布的帖子
                delresult = PlatMsgBLL.SingleModel.DelMsg(Id, userId, r.Id);
            }
            else
            {
                //  log4net.LogHelper.WriteInfo(this.GetType(), "删除收藏");
                delresult = PlatUserFavoriteMsgBLL.SingleModel.DelMolde(Id, userId, r.Id);
            }

            if (!delresult)
            {
                returnObj.Msg = "操作异常";
                return(Json(returnObj));
            }

            returnObj.isok = true;
            returnObj.Msg  = "删除成功";
            return(Json(returnObj));
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 获取平台入驻模式配置
        /// </summary>
        /// <param name="aid"></param>
        /// <param name="configType"></param>
        /// <returns></returns>
        public ActionResult GetAddStoreConfig(int aid = 0)
        {
            returnObj = new Return_Msg_APP();
            if (aid <= 0)
            {
                returnObj.Msg = "参数错误";
                return(Json(returnObj, JsonRequestBehavior.AllowGet));
            }

            int totalCount = 0;
            List <PlatStoreAddRules> list = PlatStoreAddRulesBLL.SingleModel.getListByaid(aid, out totalCount, 1000, 1);
            PlatStoreAddSetting      platStoreAddSetting = PlatStoreAddSettingBLL.SingleModel.GetPlatStoreAddSetting(aid);

            returnObj.dataObj = new { AddWay = (platStoreAddSetting != null? platStoreAddSetting.AddWay:0), rules = list };
            returnObj.isok    = true;
            return(Json(returnObj, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 30
0
        public ActionResult GetKPZFreight()
        {
            int    storeid    = Context.GetRequestInt("storeid", 0);
            int    aid        = Context.GetRequestInt("aid", 0);
            string lat        = Context.GetRequest("lat", string.Empty);
            string lnt        = Context.GetRequest("lnt", string.Empty);
            int    orderprice = Context.GetRequestInt("orderprice", 0);

            returnObj = new Return_Msg_APP();

            string msg = "";

            returnObj.dataObj = DistributionApiConfigBLL.SingleModel.Getpeisongfei("", "", "", lat, lnt, "", "", "", ref msg, (int)miniAppOrderGetWay.快跑者配送, storeid, aid, orderprice);

            returnObj.isok = !(msg.Length > 0);
            returnObj.Msg  = msg;

            return(Json(returnObj));
        }