public object GetCheckContact(string contact, string certificate) { CheckShopManageLogin(); if (!CheckCertificate(certificate)) { return(ErrorResult("凭证无效")); } PluginInfo pluginInfo; var isMobile = Core.Helper.ValidateHelper.IsMobile(contact); if (isMobile) { pluginInfo = PluginsManagement.GetInstalledPluginInfos(Core.Plugins.PluginType.SMS).First(); } else { pluginInfo = PluginsManagement.GetInstalledPluginInfos(PluginType.Email).First(); } var user = MemberApplication.GetMemberByName(CurrentUser.UserName); MemberApplication.UpdateMemberContacts(new MemberContacts() { Contact = contact, ServiceProvider = pluginInfo.PluginId, UserId = user.Id, UserType = MemberContactInfo.UserTypes.General }); return(SuccessResult()); }
///// <summary> ///// 发送验证码(提现验证码) ///// </summary> ///// <returns></returns> //public object SendWithdrawCode(ShopApplyWithDrawModel model) //{ // CheckShopManageLogin(); // ; // //获取站点配置信息 // var siteSetting = SiteSettingApplication.GetSiteSettings(); // var user = MemberApplication.GetMemberByName(CurrentUser.UserName); // Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(user.Id); // if (!mMemberAccountSafety.BindPhone) // { // return Json(new Result() { success = false, msg = "未绑定手机号" }); // } // if (!ShopApplication.SendCode("Himall.Plugin.Message.SMS", mMemberAccountSafety.Phone, user.UserName, siteSetting.SiteName)) // { // return Json(new Result() { success = false, msg = "120秒内只允许请求一次,请稍后重试!" }); // } // return Json(new Result() { success = true, msg = "发送成功" }); //} ///// <summary> ///// 检查验证码是否正确(提现验证码) ///// </summary> ///// <param name="code"></param> ///// <returns></returns> //public object WithdrawCodeCheck(ShopApplyWithDrawModel model) //{ // CheckShopManageLogin(); // ; // var user = MemberApplication.GetMemberByName(CurrentUser.UserName); // Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(user.Id); // int result = ShopApplication.CheckCode("Himall.Plugin.Message.SMS", model.Code, mMemberAccountSafety.Phone, user.UserName); // if (result > 0) // return Json(new Result() { success = true }); // else // return Json(new Result() { success = false, msg = "验证码错误" }); //} #endregion #region /*绑定银行卡验证码发送和验证*/ ///// <summary> ///// 发送验证码(绑定银行卡) ///// </summary> ///// <returns></returns> //public object SendBindBankCode(ShopApplyWithDrawModel model) //{ // CheckShopManageLogin(); // ; // //获取站点配置信息 // var siteSetting = SiteSettingApplication.GetSiteSettings(); // var user = MemberApplication.GetMemberByName(CurrentUser.UserName); // Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(user.Id); // if (!mMemberAccountSafety.BindPhone) // { // return Json(new Result() { success = false, msg = "未绑定手机号" }); // } // if (!ShopApplication.BindBankSendCode("Himall.Plugin.Message.SMS", mMemberAccountSafety.Phone, user.UserName, siteSetting.SiteName)) // { // return Json(new Result() { success = false, msg = "120秒内只允许请求一次,请稍后重试!" }); // } // return Json(new Result() { success = true, msg = "发送成功" }); //} ///// <summary> ///// 检查验证码是否正确(绑定银行卡) ///// </summary> ///// <param name="code"></param> ///// <returns></returns> //public object BindBankCodeCheck(ShopApplyWithDrawModel model) //{ // CheckShopManageLogin(); // ; // var user = MemberApplication.GetMemberByName(CurrentUser.UserName); // Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(user.Id); // int result = ShopApplication.BindBankCheckCode("Himall.Plugin.Message.SMS", model.Code, mMemberAccountSafety.Phone, user.UserName); // if (result > 0) // return Json(new Result() { success = true }); // else // return Json(new Result() { success = false, msg = "验证码错误" }); //} #endregion /// <summary> /// 发送验证码之前验证联系方式 /// </summary> /// <param name="contact"></param> /// <returns></returns> protected override bool CheckContact(string contact, out string errorMessage) { CheckShopManageLogin(); //获取站点配置信息 var siteSetting = SiteSettingApplication.GetSiteSettings(); var user = MemberApplication.GetMemberByName(CurrentUser.UserName); var mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(user.Id); Cache.Insert(_encryptKey + contact, CurrentUser.Id, DateTime.Now.AddHours(1)); errorMessage = "未绑定手机号"; return(mMemberAccountSafety.BindPhone); }
/// <summary> /// 获取可提现金额 /// </summary> /// <returns></returns> public object GetWithdraw() { CheckShopManageLogin();; //获取诊所账户信息 DTO.ShopAccount shopAccount = BillingApplication.GetShopAccount(CurrentShop.Id); //获取站点配置信息 var siteSetting = SiteSettingApplication.GetSiteSettings(); //获取加盟商账户余额 var balance = 0m; if (shopAccount != null) { balance = shopAccount.Balance; } //判断诊所是否绑定银行卡 bool IsBindBank = true; if (string.IsNullOrWhiteSpace(CurrentShop.BankAccountNumber)) { IsBindBank = false; } var user = MemberApplication.GetMemberByName(CurrentUser.UserName); Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(user.Id); return(Json(new { success = true, //状态 msg = "", Balance = balance, //诊所账户余额 RealMoney = (MAX_WithDraw_Money - balance) <= 0 ? MAX_WithDraw_Money : balance, //实际可提现金额 //实际可提现金额 BankAccountName = CurrentShop.BankAccountName, //银行开户名 BankAccountNumber = CurrentShop.BankAccountNumber, //银行账号 BankName = CurrentShop.BankName, //开户银行名称 IsBindBank = IsBindBank, //诊所是否绑定银行卡号 true=已绑定 Phone = mMemberAccountSafety.Phone, // 手机号码 BankBranch = CurrentShop.BankName //开户银行支行完整名称 })); }