示例#1
0
        public string GetPayType(int UserId)
        {
            int TypeId       = (int)Logic.KeyValueType.支付类型管理;
            var listKeyValue = MemcachHelper.Get <List <KeyValue> >(Constant.list_keyvalue_key + TypeId, DateTime.Now.AddDays(7), () =>
            {
                return(keyValueDao.GetQuery("typeid=@TypeId ", new { TypeId }, "order by Sort desc,CTime desc"));
            });
            Users user = usersDao.Single(UserId);

            Logic.VipType vip  = (Logic.VipType)user.VipType;
            JArray        list = new JArray();


            foreach (var item in listKeyValue)
            {
                JObject m = JObject.Parse(item.Value);

                JObject data    = new JObject();
                int     PayType = m["PayType"].ToInt();
                data["PayType"] = PayType;

                data["PayName"]  = m["PayName"].ToString();
                data["Quota"]    = m["Quota"].ToString();
                data["WithDraw"] = m["WithDraw"].ToString();
                data["Time"]     = m["Time"].ToString();
                data["Remark"]   = m["Remark"].ToString();

                decimal[] r = Constant.GetRate(PayType, vip);
                data["Fee"] = $"{r[0].perCent()}+{r[1].ToString("F1")}元/笔";
                list.Add(data);
            }
            return(ApiReturnStr.getApiDataList(list));
        }
示例#2
0
        public string GetBankList()
        {
            JArray list = new JArray();

            foreach (var item in bankLists)
            {
                list.Add(item);
            }
            return(ApiReturnStr.getApiDataList(list));
        }
示例#3
0
        public string GetVipTypeIntroduce(int cid = 0, int VipType = 0)
        {
            if (VipType < 0)
            {
                return(ApiReturnStr.getError(-100, "参数错误"));
            }
            var version = TQuery.GetString("version");

            if (VipType == 1 && version == "1.0.0" && cid == 3)
            {
                VipType = 4;
            }

            int TypeId       = (int)Logic.KeyValueType.支付类型管理;
            var listKeyValue = MemcachHelper.Get <List <KeyValue> >(Constant.list_keyvalue_key + TypeId, DateTime.Now.AddDays(7), () =>
            {
                return(keyValueDao.GetQuery("typeid=@TypeId ", new { TypeId }, "order by Sort desc,CTime desc"));
            });

            Logic.VipType vip  = (Logic.VipType)VipType;
            JArray        list = new JArray();

            foreach (var item in listKeyValue)
            {
                JObject m       = JObject.Parse(item.Value);
                JObject data    = new JObject();
                int     PayType = m["PayType"].ToInt();
                data["PayName"] = m["PayName"].ToString();
                data["Quota"]   = m["Quota"].ToString();
                decimal[] r = Constant.GetRate(PayType, vip);
                data["Fee"] = $"{r[0].perCent()}+{r[1].ToString("F1")}元/笔";
                if (!(PayType == 1 && vip == Logic.VipType.顶级代理))//顶级代理隐藏无积分费率
                {
                    list.Add(data);
                }
            }
            return(ApiReturnStr.getApiDataList(list));
        }
示例#4
0
        public string GetAreaCode(int BaseId = 0)
        {
            List <AreaCode> listArea = MemcachHelper.Get <List <AreaCode> >(Constant.list_area_key + BaseId, DateTime.Now.AddDays(7), () =>
            {
                return(areaCodeDao.GetQuery("BaseId=@BaseId", new { BaseId }, " order by sort asc "));
            });

            JArray list = new JArray();

            if (listArea != null && listArea.Count > 0)
            {
                foreach (var item in listArea)
                {
                    JObject obj = new JObject();
                    obj["Id"]   = item.ID;
                    obj["Code"] = item.Code;
                    obj["Name"] = item.Name;
                    list.Add(obj);
                }
            }

            return(ApiReturnStr.getApiDataList(list));
        }
示例#5
0
        public string GetPayBankQuotaList()
        {
            List <BankQuota> listBank = MemcachHelper.Get <List <BankQuota> >(Constant.list_bank_quota_key, DateTime.Now.AddDays(7), () =>
            {
                return(bankQuotaDao.GetQuery("1=1"));
            });

            JArray list = new JArray();

            if (listBank != null && listBank.Count > 0)
            {
                foreach (var item in listBank)
                {
                    JObject obj = new JObject();
                    obj["Id"] = item.ID;

                    obj["SingleQuota"] = item.SingleQuota.ToString("F0");
                    obj["DayQuota"]    = item.DayQuota.ToString("F0");
                    obj["MouthQuota"]  = item.MouthQuota.ToString("F0");
                    list.Add(obj);
                }
            }
            return(ApiReturnStr.getApiDataList(list));
        }
示例#6
0
        public string BannerList(int UserId, int cid, string version)
        {
            JArray list          = new JArray();
            var    serverVersion = keyValueDao.GetAuditingVersion(cid);

            if (serverVersion == version && cid == (int)Logic.Platform.iOS)
            {
                JObject data = new JObject();
                data["ID"]     = 100;
                data["Title"]  = "火爆上线";
                data["WapURL"] = "";
                data["ImgUrl"] = ITOrm.Utility.Const.Constant.StaticHost + "upload/banner/default.png";
                list.Add(data);
                return(ApiReturnStr.getApiDataList(list));
            }

            List <Banner> listBanner = MemcachHelper.Get <List <Banner> >(Constant.list_banner_key, DateTime.Now.AddDays(7), () =>
            {
                return(bannerDao.GetQuery(10, " State=1 AND GETDATE() BETWEEN StartTime AND EndTime", null, "ORDER BY Sort DESC,ID DESC"));
            });


            if (listBanner != null && listBanner.Count > 0)
            {
                foreach (var item in listBanner)
                {
                    JObject data = new JObject();
                    data["ID"]     = item.ID;
                    data["Title"]  = item.Title;
                    data["WapURL"] = item.WapURL;
                    data["ImgUrl"] = ITOrm.Utility.Const.Constant.StaticHost + item.ImgUrl;
                    list.Add(data);
                }
            }
            return(ApiReturnStr.getApiDataList(list));
        }
示例#7
0
        public string GetBankList(int TypeId = 0)
        {
            //Logs.WriteLog($"1111", "d:\\Log\\", "GetBankList");
            List <Bank> listBank = MemcachHelper.Get <List <Bank> >(Constant.list_bank_key, DateTime.Now.AddHours(1), () =>
            {
                return(bankDao.GetQuery(" State<>-1 "));
            });

            JArray list = new JArray();

            if (listBank != null && listBank.Count > 0)
            {
                foreach (var item in listBank)
                {
                    JObject obj = new JObject();
                    obj["BankName"] = item.BankName;
                    obj["BankCode"] = item.BankCode;
                    obj["State"]    = item.State;
                    obj["StateTxt"] = item.State == 0 ? "可用" : "不可用";
                    obj["ICON"]     = $"{Constant.StaticHost}upload/bank/80/{item.BankCode}.png";

                    if (TypeId == 1)                          //实名认证所用
                    {
                        if (bankList.Contains(item.BankName)) //收款支持的银行
                        {
                            list.Add(obj);
                        }
                    }
                    else//信用卡所用
                    {
                        list.Add(obj);
                    }
                }
            }
            return(ApiReturnStr.getApiDataList(list));
        }