From 85a61afb0636f25386ea552fea708b49509a96a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Wed, 13 Mar 2024 16:18:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E9=82=80=E8=AF=B7vip?= =?UTF-8?q?=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/CustomerController.cs | 5 +++++ New_College.IServices/IV_CustomerInfoServices.cs | 2 ++ New_College.Services/V_CustomerInfoServices.cs | 10 +++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index 24b9b36..00c3ee7 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -240,6 +240,11 @@ namespace New_College.Api.Controllers.Front FansId = fancId, SaleId = saleId, }); + var count = (await _fansDistributionServices.Query(e => e.SaleId == saleId)).Count();//判断邀请人数是否满足三个人 + if (count >= 3) + { + await _services.UpdateIsVip(saleId); + } return true; } } diff --git a/New_College.IServices/IV_CustomerInfoServices.cs b/New_College.IServices/IV_CustomerInfoServices.cs index 19d0d02..204d1fb 100644 --- a/New_College.IServices/IV_CustomerInfoServices.cs +++ b/New_College.IServices/IV_CustomerInfoServices.cs @@ -13,6 +13,8 @@ namespace New_College.IServices /// public interface IV_CustomerInfoServices : IBaseServices { + + Task UpdateIsVip(int saleId); Task Login(CustomerInfoQuery query); Task SendLogin(PhoneQuery query); diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs index 9ed2e0c..47f3dbf 100644 --- a/New_College.Services/V_CustomerInfoServices.cs +++ b/New_College.Services/V_CustomerInfoServices.cs @@ -40,6 +40,14 @@ namespace New_College.Services } + /// + /// 根据要求更新vip状态 + /// + /// + public async Task UpdateIsVip(int saleId) + { + return await this._dal.Update(string.Format("update V_CustomerInfo set IsVIP=1 where Id={0}", saleId)); + } /// /// 同步修改密码 /// @@ -90,7 +98,7 @@ namespace New_College.Services info.UserPwd = MD5Helper.MD5Encrypt16(query.UserPwd + salt); } var result = await _dal.Update(info); - + return new CustomerInfoResult() { Status = 1,