优惠券

This commit is contained in:
“wanyongkang”
2021-03-30 21:17:43 +08:00
parent 7ede35d5cf
commit 99e6255230
15 changed files with 141 additions and 53 deletions

View File

@@ -599,7 +599,7 @@ namespace Home.Controllers
pas_result += rnd.ToString();
}
Console.WriteLine("==================================================================");
// Console.WriteLine("==================================================================");
string msg = "";
@@ -615,7 +615,7 @@ namespace Home.Controllers
id_code=""
};
var ret = await m_UserService.Regist(userEntity);
msg = "您好打开网址juip.com登录会员名"+phone+""+notifyOrder.Payment+"元已充值到此账户),密码:"+pas_result+"。登录后点击网站上方的-产品购买,即可完成开通或续费。淘宝付款将随机赠送优惠券,欢迎您多来淘宝下单";
msg = "您好打开网址juip.com登录会员名"+phone+""+notifyOrder.Payment+"元已充值到此账户),密码:"+pas_result+"。登录后点击网站上方的-产品购买,即可完成开通或续费。恭喜您本次获得优惠券满4元减1元满20元减3元满54元减5元满130元减15元满490元减30元各一张。欢迎您多来淘宝下单";
if (ret.Code != ResultCode.C_SUCCESS) return msg;
} else {
@@ -625,7 +625,7 @@ namespace Home.Controllers
userEntity.TaoBao= notifyOrder.BuyerNick;
await m_UserService.Update(userEntity);
}
msg = "您好,"+notifyOrder.Payment+"元已充值到充值到您的会员中,会员号为:"+userEntity.LoginCode+"打开网址juip.com登录后点击网站上方的-产品购买,即可完成开通或续费。淘宝付款将随机赠送优惠券,欢迎您多来淘宝下单";
msg = "您好,"+notifyOrder.Payment+"元已充值到充值到您的会员中,会员号为:"+userEntity.LoginCode+"打开网址juip.com登录后点击网站上方的-产品购买,即可完成开通或续费。恭喜您本次获得优惠券满4元减1元满20元减3元满54元减5元满130元减15元满490元减30元各一张。欢迎您多来淘宝下单";
}
@@ -638,7 +638,11 @@ namespace Home.Controllers
AttchInfo = notifyOrder.Tid
};
var retAmount = await m_UserService.UpdateAmount(amountInfo);
await m_CouponService.TaoBaoGive(userEntity.Id, 9, notifyOrder.BuyerNick);
await m_CouponService.TaoBaoGive(userEntity.Id, 11, notifyOrder.BuyerNick);
await m_CouponService.TaoBaoGive(userEntity.Id, 12, notifyOrder.BuyerNick);
await m_CouponService.TaoBaoGive(userEntity.Id, 13, notifyOrder.BuyerNick);
await m_CouponService.TaoBaoGive(userEntity.Id, 14, notifyOrder.BuyerNick);
await m_CouponService.TaoBaoGive(userEntity.Id, 15, notifyOrder.BuyerNick);
var taobaoEntity = notifyOrder.MapTo<TaoBaoOrderEntity>();

View File

@@ -25,8 +25,24 @@
var baseUrl = m_Configuration["BaseInfoUrl"];
Func<string, string> P = (path) => $"{baseUrl}{path}";
}
<div class="cpBanner">
@* <div class="cpBanner">
<img src="~/m/img/cpBanner.png">
</div> *@
<div class="cpBanner" style="background-image: url(/img/acBanner_1.png?11231);background-repeat:round;background-size:auto auto;height:330px;">
<div class="row" style="color:white;width:calc(100vw-1px);text-align:center;padding-top:10px;">
<div class="col-md-8 " style="padding-top:1.5%;">
<h2 >十余种全网知名旗舰产品低价热销</h2>
<h1 style="font-size:45px;">淘宝动态IP销量排名NO.1</h1>
<h4 style="color: #e45b4b;">已完美对接淘宝、淘宝付款后、金额将自动充值到您的会员余额中</h4>
<a target="_blank" href="https://item.taobao.com/item.htm?spm=a230r.1.14.54.79837218R25iC8&id=640496688304&ns=1&abbucket=9#detail"><h4 style="color: #e45b4b;">您在淘宝每次付款都会随机赠送优惠券最低54元优惠券支持所有套餐<br><span style="color:#FFFF00;">点击去淘宝店铺付款&nbsp;<span class="glyphicon glyphicon-arrow-right"></span></span></h4></a>
</div>
<div class="col-md-3 col-md-offset-1" style="padding-top:2%;">
<h1>需求<span style="color: red;font-size:49px;">五个</span>以上</h1>
<h2>联系客服设置优惠价</h2>
<a target="_blank" href="https://admin.qidian.qq.com/template/blue/mp/menu/qr-code-jump.html?linkType=0&env=ol&kfuin=2852138148&fid=299&key=f377ec024ca45115a03a7632c7bda230&cate=1&source=&isLBS=&isCustomEntry=&type=16&ftype=1&_type=wpa&qidian=true"><h3 style="color: #e45b4b;">>>>联系客服<<<</h3></a>
</div>
</div>
</div>
<div class="cpNav">
<div class="item">

View File

@@ -17,8 +17,24 @@
Func<string, string> P = (path) => $"{baseUrl}{path}";
}
<div class="cpBanner">
@* <div class="cpBanner">
<img src="~/m/img/cpBanner.png">
</div> *@
<div class="cpBanner" style="background-image: url(/img/acBanner_1.png?11231);background-repeat:round;background-size:auto auto;height:330px;">
<div class="row" style="color:white;width:calc(100vw-1px);text-align:center;padding-top:10px;">
<div class="col-md-8 " style="padding-top:1.5%;">
<h2 >十余种全网知名旗舰产品低价热销</h2>
<h1 style="font-size:45px;">淘宝动态IP销量排名NO.1</h1>
<h4 style="color: #e45b4b;">已完美对接淘宝、淘宝付款后、金额将自动充值到您的会员余额中</h4>
<a target="_blank" href="https://item.taobao.com/item.htm?spm=a230r.1.14.54.79837218R25iC8&id=640496688304&ns=1&abbucket=9#detail"><h4 style="color: #e45b4b;">您在淘宝每次付款都会随机赠送优惠券最低54元优惠券支持所有套餐<br><span style="color:#FFFF00;">点击去淘宝店铺付款&nbsp;<span class="glyphicon glyphicon-arrow-right"></span></span></h4></a>
</div>
<div class="col-md-3 col-md-offset-1" style="padding-top:2%;">
<h1>需求<span style="color: red;font-size:49px;">五个</span>以上</h1>
<h2>联系客服设置优惠价</h2>
<a target="_blank" href="https://admin.qidian.qq.com/template/blue/mp/menu/qr-code-jump.html?linkType=0&env=ol&kfuin=2852138148&fid=299&key=f377ec024ca45115a03a7632c7bda230&cate=1&source=&isLBS=&isCustomEntry=&type=16&ftype=1&_type=wpa&qidian=true"><h3 style="color: #e45b4b;">>>>联系客服<<<</h3></a>
</div>
</div>
</div>
<div class="cpNav">
<div class="item">

View File

@@ -190,7 +190,7 @@
<li><a asp-action="index" asp-controller="LineList" asp-route-Catalog="1">线路表</a> </li>
<li><a asp-action="soft" asp-controller="product">软件下载</a> </li>
<li><a asp-action="index" asp-controller="article">教程&咨询</a></li>
<li><a asp-action="taobao" asp-controller="article">淘宝充值活动</a></li>
@* <li><a asp-action="taobao" asp-controller="article">淘宝充值活动</a></li> *@
@if (user != null)
{
<li><a asp-action="index" asp-controller="user">个人中心</a></li>

View File

@@ -380,7 +380,7 @@
<li><a href="/LineList/index">IP线路表</a></li>
<li><a href="/product/soft">软件下载</a></li>
<li><a href="/article/index">教程&咨询</a></li>
<li><a href="/article/taobao">淘宝充值活动</a></li>
@* <li><a href="/article/taobao">淘宝充值活动</a></li> *@
<li>
@if (user == null)
{

View File

@@ -142,7 +142,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "免费送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -171,7 +171,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折+送十天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -201,7 +201,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "七折+送一月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -260,7 +260,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -289,7 +289,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -318,7 +318,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -347,7 +347,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折+送两个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -377,7 +377,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -407,7 +407,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -435,7 +435,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -483,8 +483,24 @@
</style>
<!-- ad -->
<div id="hidebg"></div>
<div class="container-fluid ad">
@* <div class="container-fluid ad">
<a asp-action="taobao" asp-controller="article"> <img src="~/img/acBanner.png"></a>
</div> *@
<div class="container-fluid ad" style="background-image: url(/img/acBanner_1.png?11231);background-repeat:no-repeat;background-size:100% auto;height:270px;">
<div class="row" style="color:white;width:calc(100vw-1px);">
<div class="col-md-3 col-md-offset-1" style="padding-top:2%;text-align:center;">
<h1>需求<span style="color: red;font-size:49px;">五个</span>以上</h1>
<h2>联系客服设置优惠价</h2>
<a target="_blank" href="https://admin.qidian.qq.com/template/blue/mp/menu/qr-code-jump.html?linkType=0&env=ol&kfuin=2852138148&fid=299&key=f377ec024ca45115a03a7632c7bda230&cate=1&source=&isLBS=&isCustomEntry=&type=16&ftype=1&_type=wpa&qidian=true"><h3 style="color: #e45b4b;">>>>联系客服<<<</h3></a>
</div>
<div class="col-md-8 " style="padding-top:1.5%;">
<h2 style="padding-left:8%;">十余种全网知名旗舰产品低价热销</h2>
<h1 style="font-size:45px;padding-left:6%;">淘宝动态IP销量排名NO.1</h1>
<h4 style="color: #e45b4b;padding-left:5%;">已完美对接淘宝、淘宝付款后、金额将自动充值到您的会员余额中</h4>
<a target="_blank" href="https://item.taobao.com/item.htm?spm=a230r.1.14.54.79837218R25iC8&id=640496688304&ns=1&abbucket=9#detail"><h4 style="color: #e45b4b;padding-left:2%;">您在淘宝每次付款都会随机赠送优惠券最低54元优惠券支持所有套餐&nbsp;<span style="color:#FFFF00;">点击去淘宝店铺付款&nbsp;<span class="glyphicon glyphicon-arrow-right"></span></span></h4></a>
</div>
</div>
</div>
@*新布局*@
<p class="text-center tit"><img src="~/img/titi_choose.png"></p>

View File

@@ -50,7 +50,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "免费送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -79,7 +79,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "免费送十天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -109,7 +109,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "七折+送一月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -139,7 +139,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "免费送十天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -172,7 +172,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -197,7 +197,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -226,7 +226,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -255,7 +255,7 @@
line-height: 0px;
color: white;
height: 0px;
border: 1.0rem solid #f64e3d;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "八折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
@@ -273,8 +273,24 @@
</style>
<!-- ad -->
<div class="container-fluid ad">
@* <div class="container-fluid ad">
<a asp-action="taobao" asp-controller="article"> <img src="~/img/acBanner.png"></a>
</div> *@
<div class="container-fluid ad" style="background-image: url(/img/acBanner_1.png?11231);background-repeat:no-repeat;background-size:100% auto;height:270px;">
<div class="row" style="color:white;width:calc(100vw-1px);">
<div class="col-md-3 col-md-offset-1" style="padding-top:2%;text-align:center;">
<h1>需求<span style="color: red;font-size:49px;">五个</span>以上</h1>
<h2>联系客服设置优惠价</h2>
<a target="_blank" href="https://admin.qidian.qq.com/template/blue/mp/menu/qr-code-jump.html?linkType=0&env=ol&kfuin=2852138148&fid=299&key=f377ec024ca45115a03a7632c7bda230&cate=1&source=&isLBS=&isCustomEntry=&type=16&ftype=1&_type=wpa&qidian=true"><h3 style="color: #e45b4b;">>>>联系客服<<<</h3></a>
</div>
<div class="col-md-8 " style="padding-top:1.5%;">
<h2 style="padding-left:8%;">十余种全网知名旗舰产品低价热销</h2>
<h1 style="font-size:45px;padding-left:6%;">淘宝动态IP销量排名NO.1</h1>
<h4 style="color: #e45b4b;padding-left:5%;">已完美对接淘宝、淘宝付款后、金额将自动充值到您的会员余额中</h4>
<a target="_blank" href="https://item.taobao.com/item.htm?spm=a230r.1.14.54.79837218R25iC8&id=640496688304&ns=1&abbucket=9#detail"><h4 style="color: #e45b4b;padding-left:2%;">您在淘宝每次付款都会随机赠送优惠券最低54元优惠券支持所有套餐&nbsp;<span style="color:#FFFF00;">点击去淘宝店铺付款&nbsp;<span class="glyphicon glyphicon-arrow-right"></span></span></h4></a>
</div>
</div>
</div>
<div class="container stepOne packagebox" id="@("box"+defaultProduct.Id)">

View File

@@ -198,7 +198,7 @@
<li><a href="/LineList/index">IP线路表</a></li>
<li><a href="/product/soft">软件下载</a></li>
<li><a href="/article/index?Catalog=1">教程&咨询</a></li>
<li><a href="/article/taobao">淘宝充值活动</a></li>
@* <li><a href="/article/taobao">淘宝充值活动</a></li> *@
<li>
@if (user == null)
{

View File

@@ -165,7 +165,7 @@
<li><a href="/LineList/index" ">IP线路表</a></li>
<li><a href="/product/soft">软件下载</a></li>
<li><a href="/article/index">教程&咨询</a></li>
<li><a href="/article/taobao">淘宝充值活动</a></li>
@* <li><a href="/article/taobao">淘宝充值活动</a></li> *@
<li>
<img src="/img/account.png" onmouseover="$('.exitBox').show()">
<div class="exitBox" onmouseleave="$('.exitBox').hide()">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 568 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -33,11 +33,11 @@ namespace Hncore.Pass.Live.Controllers
var entity = request.MapTo<CouponEntity>();
if (entity.Name.NotHas())
{
return Error("名称不能为空");
return Error("<EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
}
if (m_CouponService.Exist(m => m.Name == entity.Name))
{
return Error("名称已经存在了");
return Error("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
var ret = await m_CouponService.Add(entity);
return Success();
@@ -49,15 +49,15 @@ namespace Hncore.Pass.Live.Controllers
var entity = await m_CouponService.GetById(request.Id);
if (entity == null)
{
return Error("优惠券不存在");
return Error("<EFBFBD>Ż<EFBFBD>ȯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
if (request.Name.NotHas())
{
return Error("名称不能为空");
return Error("<EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
}
if (m_CouponService.Exist(m => m.Id != request.Id && m.Name == request.Name))
{
return Error("名称已经存在了");
return Error("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
entity.Name = request.Name;
@@ -84,7 +84,7 @@ namespace Hncore.Pass.Live.Controllers
var redeemCode = await m_CouponService.GetById(Id);
if (redeemCode == null)
{
return Error("该优惠券不存在");
return Error("<EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD>ȯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
redeemCode.Disabled = 1;
await m_CouponService.Update(redeemCode);
@@ -113,7 +113,7 @@ namespace Hncore.Pass.Live.Controllers
}
/// <summary>
/// 查询
/// <EFBFBD><EFBFBD>ѯ
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
@@ -135,11 +135,11 @@ namespace Hncore.Pass.Live.Controllers
{
if (request.CouponId==0)
{
return Error("请选择优惠券");
return Error("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD>ȯ");
}
if (request.UserId == 0)
{
return Error("请选择用户");
return Error("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>");
}
await this.m_CouponService.Give(request.CouponId, this.Request.GetManageUserInfo().OperaterId.ToString(), request.UserId, 1);
return Success();

View File

@@ -78,7 +78,7 @@ namespace Hncore.Pass.Sells.Service
public async Task<List<UserCouponModel>> GetUserCoupon(int userId)
{
var oroginCoupons = m_CouponUserOrginService.Query(m => m.ToUser == userId);
var oroginCoupons = m_CouponUserOrginService.Query(m => m.ToUser == userId && DateTime.Now <= m.EndTime);
var hasCoupon = from orgin in oroginCoupons
join coupon in this.Query(true) on orgin.CouponId equals coupon.Id
@@ -126,8 +126,6 @@ namespace Hncore.Pass.Sells.Service
public async Task<bool> TaoBaoGive(int userId, int couponId,string taobao)
{
if (m_CouponUserOrginService.Exist(m => (m.ToUser == userId||m.ToUserRef== taobao) && m.CreateDate.Value.Month == DateTime.Now.Month))
return false;
return await this.Give(couponId, "", userId, 1, CouponOriginType.TaoBao,"系统赠送",taobao);
}

View File

@@ -247,11 +247,16 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
}
//是否已经设置会员价
var is_user_price = true;
var price = packageEntity.Price;
var userPrice = await this.m_ProductUserPriceService.Query(true).FirstOrDefaultAsync(m => m.UserId == userId && m.PackageId == packageEntity.Id && m.Status == 1);
if (userPrice != null && userPrice.UserPrice > 0)
{
price = userPrice.UserPrice;
is_user_price = false;
}
if (ProductAccountCount == 0 && request.OrderType != OrderType.News && packageEntity.DayCount == 1 && request.ConnectCount == 1 && request.OrderType!=OrderType.AgainBuy&& request.OrderType!=OrderType.AgainBuys){
price = 0.1M;
@@ -329,7 +334,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
await CheckRequest(order);
var ret = await CaclePaymentAmount(order, request.UseAccountAmount);
var ret = await CaclePaymentAmount(order, request.UseAccountAmount, is_user_price);
if (ret.Code != ResultCode.C_SUCCESS) return ret;
@@ -353,7 +358,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
return new ApiResult<ProductOrderEntity>(order);
}
public async Task<ApiResult<ProductOrderEntity>> CaclePaymentAmount(ProductOrderEntity order, int useAccountAmount)
public async Task<ApiResult<ProductOrderEntity>> CaclePaymentAmount(ProductOrderEntity order, int useAccountAmount, bool is_user_price = true)
{
using (await _mutex1.LockAsync())
{
@@ -363,16 +368,33 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
if (order.CouponId > 0)
{
var currentCoupon = await m_CouponService.GetOneUserAvailableCoupon(userEntity.Id, order.CouponId.Value);
if (currentCoupon == null)
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "没有可用的优惠券");
if (currentCoupon.Coupon.AllowMinAmount > 0 && order.OrderAmount < currentCoupon.Coupon.AllowMinAmount)
{
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, $"满{currentCoupon.Coupon.AllowMinAmount}元才能使用");
if(currentCoupon.Coupon.Id<16 ){
if(is_user_price){
if (currentCoupon == null)
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "没有可用的优惠券");
if (currentCoupon.Coupon.AllowMinAmount > 0 && order.OrderAmount < currentCoupon.Coupon.AllowMinAmount)
{
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, $"满{currentCoupon.Coupon.AllowMinAmount}元才能使用");
}
if (currentCoupon.Coupon.CouponType == Sells.Model.ECouponType.Minus)
couponAmount = currentCoupon.Coupon.CouponValue;
else
couponAmount = order.OrderAmount * (currentCoupon.Coupon.CouponValue * 0.1m);
} else {
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "您已经享有会员优惠价,无法与优惠券共享!如有需求,请联系客服!");
}
} else {
if (currentCoupon == null)
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "没有可用的优惠券");
if (currentCoupon.Coupon.AllowMinAmount > 0 && order.OrderAmount < currentCoupon.Coupon.AllowMinAmount)
{
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, $"满{currentCoupon.Coupon.AllowMinAmount}元才能使用");
}
if (currentCoupon.Coupon.CouponType == Sells.Model.ECouponType.Minus)
couponAmount = currentCoupon.Coupon.CouponValue;
else
couponAmount = order.OrderAmount * (currentCoupon.Coupon.CouponValue * 0.1m);
}
if (currentCoupon.Coupon.CouponType == Sells.Model.ECouponType.Minus)
couponAmount = currentCoupon.Coupon.CouponValue;
else
couponAmount = order.OrderAmount * (currentCoupon.Coupon.CouponValue * 0.1m);
}
order.CouponAmount = couponAmount;