设置价格 折扣

This commit is contained in:
“wanyongkang”
2021-04-20 18:42:47 +08:00
parent 81028aebd3
commit 7bbadd32c6
12 changed files with 548 additions and 227 deletions

View File

@@ -45,8 +45,10 @@ namespace Home.Controllers
WxAppUserService m_WxAppUserService;
UserService m_UserService;
ProductUserPriceService m_ProductUserPriceService;
ProductPriceSchemeService m_ProductPriceSchemeService;
public productController(ProductService _ProductService
, ProductOrderService _ProductOrderService
, ProductPriceSchemeService _ProductPriceSchemeService
, ProductPackageService _ProductPackageService
, WxPayClient _WxPayClient
,ProductAccountService _ProductAccountService
@@ -57,6 +59,7 @@ namespace Home.Controllers
{
m_ProductService = _ProductService;
m_ProductOrderService = _ProductOrderService;
m_ProductPriceSchemeService = _ProductPriceSchemeService;
m_ProductPackageService = _ProductPackageService;
m_Configuration = _Configuration;
m_WxPayClient = _WxPayClient;
@@ -86,26 +89,59 @@ namespace Home.Controllers
//从user表获取用户信息
var user_Info = await m_UserService.GetById(userInfo.UserId);
var ProductAccountCount = user_Info.ProductAccountCount;
var userPrices = await m_ProductUserPriceService.GetProductUserPrice(userInfo.UserId);
foreach(var product in respList)
{
product.Packages.ForEach(m => {
var userPrice = userPrices.FirstOrDefault(p => p.PackageId == m.Id && p.ProductId == m.ProductId);
if (userPrice != null && userPrice.UserPrice > 0)
{
m.Price = userPrice.UserPrice;
}
if (ProductAccountCount == 0 && m.DayCount == 1){
m.Price = 0.1M;
}
});
}
if(user_Info.agent_id == 0||(user_Info.agent_id != 0 && user_Info.discount_id != 0)){
//根据折扣设置价格
var discount = await m_ProductPriceSchemeService.GetById(user_Info.discount_id);
var dis_price = 1000000.0M;
foreach(var product in respList)
{
product.Packages.ForEach(m => {
if (discount != null)
{
dis_price = m.LinePrice * discount.discount / 100;
}
if(dis_price<m.Price){
m.Price = dis_price;
m.Title = discount.Remark;
} else {
m.Title = "9";
}
if (ProductAccountCount == 0 && m.DayCount == 1){
m.Price = 0.1M;
}
if(m.Price<m.MinPrice){
m.Price = m.MinPrice;
}
});
}
} else {
//根据会员价
var userPrices = await m_ProductUserPriceService.GetProductUserPrice(userInfo.UserId);
foreach(var product in respList)
{
product.Packages.ForEach(m => {
m.Title = "9";
var userPrice = userPrices.FirstOrDefault(p => p.PackageId == m.Id && p.ProductId == m.ProductId);
if (userPrice != null && userPrice.UserPrice > 0)
{
m.Price = userPrice.UserPrice;
}
if (ProductAccountCount == 0 && m.DayCount == 1){
m.Price = 0.1M;
}
});
}
}
} else {
foreach(var product in respList)
{
product.Packages.ForEach(m => {
m.Title = "9";
if ( m.DayCount == 1 ){
m.Price = 0.1M;
}
@@ -676,14 +712,32 @@ namespace Home.Controllers
var user_Info = await m_UserService.GetById(userId);
var ProductAccountCount = user_Info.ProductAccountCount;
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(package.Id, userId);
if (userPrice != null && userPrice.UserPrice > 0)
{
package.Price = userPrice.UserPrice;
var dis_price = 1000000M;
if(user_Info.agent_id == 0||(user_Info.agent_id != 0 && user_Info.discount_id != 0)){
//根据折扣设置价格
var discount = await m_ProductPriceSchemeService.GetById(user_Info.discount_id);
if (discount != null)
{
dis_price = package.LinePrice * discount.discount / 100;
}
} else {
//根据会员价
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(package.Id, userId);
if (userPrice != null && userPrice.UserPrice > 0)
{
dis_price = userPrice.UserPrice;
}
}
if(dis_price<package.Price){
package.Price = dis_price;
}
if (ProductAccountCount == 0 && package.DayCount == 1){
package.Price = 0.1M;
}
if(package.Price<package.MinPrice){
package.Price = package.MinPrice;
}
return View("buy", new PackageInfoResponse()
{
@@ -722,15 +776,50 @@ namespace Home.Controllers
var userInfo = this.Request.GetUserInfo();
if (userInfo != null)
{
var userPrices = await m_ProductUserPriceService.GetProductUserPrice(id, userInfo.UserId);
respList.Packages.ForEach(m =>
{
var userPrice = userPrices.FirstOrDefault(p => p.PackageId == m.Id);
if (userPrice != null && userPrice.UserPrice > 0)
//从user表获取用户信息
var user_Info = await m_UserService.GetById(userInfo.UserId);
if(user_Info.agent_id == 0||(user_Info.agent_id != 0 && user_Info.discount_id != 0)){
//根据折扣设置价格
var discount = await m_ProductPriceSchemeService.GetById(user_Info.discount_id);
var dis_price = 1000000.0M;
respList.Packages.ForEach(m => {
if (discount != null)
{
dis_price = m.LinePrice * discount.discount / 100;
}
if(dis_price<m.Price){
m.Price = dis_price;
m.Title = discount.Remark;
} else {
m.Title = "9";
}
if(m.Price<m.MinPrice){
m.Price = m.MinPrice;
}
});
} else {
//根据会员价
var userPrices = await m_ProductUserPriceService.GetProductUserPrice(id, userInfo.UserId);
respList.Packages.ForEach(m =>
{
m.Price = userPrice.UserPrice;
}
});
m.Title = "9";
var userPrice = userPrices.FirstOrDefault(p => p.PackageId == m.Id);
if (userPrice != null && userPrice.UserPrice > 0)
{
m.Price = userPrice.UserPrice;
}
});
}
}
return View(respList);
}
@@ -753,11 +842,32 @@ namespace Home.Controllers
var accountEntity = await m_ProductAccountService.GetProductAccountInfo(package.ProductId, account);
var userId = this.Request.GetUserInfo().UserId;
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(packageId, userId);
if (userPrice != null && userPrice.UserPrice > 0)
{
package.Price = userPrice.UserPrice;
var user_Info = await m_UserService.GetById(userId);
var dis_price = 1000000M;
if(user_Info.agent_id == 0||(user_Info.agent_id != 0 && user_Info.discount_id != 0)){
//根据折扣设置价格
var discount = await m_ProductPriceSchemeService.GetById(user_Info.discount_id);
if (discount != null)
{
dis_price = package.LinePrice * discount.discount / 100;
}
} else {
//根据会员价
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(packageId, userId);
if (userPrice != null && userPrice.UserPrice > 0)
{
dis_price = userPrice.UserPrice;
}
}
if(dis_price<package.Price){
package.Price = dis_price;
}
if(package.Price<package.MinPrice){
package.Price = package.MinPrice;
}
var model = new PackageInfoResponse()
{

View File

@@ -289,12 +289,15 @@
<div style="font-size: 15px;">
<h3 style="margin-top: 0px;margin-bottom: 10px;display:inline;color:red;background-color:#FFFF00;">公告</h3><a style="cursor:pointer;display:inline;float:right;" onclick="know()">X</a>
<h4 style="margin-top: 10px;">老鹰IP已恢复运营已更新最新的IP池产品稳定性也做了大幅度的升级</h4>
<h4>老鹰IP已加入8折助攻计划月卡仅需54元量大价更低</h4>
<h4 style="margin-top: 10px;">聚IP官网已更新为自动更改折扣优惠价</h4>
<p>总消费超过200自动升级为白银9折</p>
<p>总消费超过500自动升级为黄金8折</p>
<p>...</p>
<p>几乎所有用户在此次自动更新后优惠都变的更大了,可能出现个别用户价格比之前的高,可联系客服帮您更改手动更改折扣。</p>
<p>如果您对价格有疑问也可联系客服帮您更改折扣!</p>
<p>如果您有更大用量或销量,可咨询客服获取更低的折扣!</p>
<p>1.动态IP一毛钱一天每用户限一次。</p>
<p>2.复工季聚IP助力开工全部产品所有套餐8折狂欢价月卡低至50多量大价更低</p>
<p>3.月卡送10天双月卡送一个月部分产品参加。</p>
<p>4.新上老鹰IP蘑菇IP西瓜IP新上安卓APP。</p>
</div>
<p >

View File

@@ -38,7 +38,7 @@
<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>
<h1>总消费满<span style="color: red;font-size:49px;">200</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>
@@ -245,7 +245,11 @@
<a asp-action="buy" asp-controller="product" asp-route-id="@package.Id">
<div class="card color_@((item.Packages.IndexOf(package)+1)%5)">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name 九折</p>
@if(package.Title != ""){
<p style="font-size: 35px;color:#FFFF00;">@package.Name @package.Title 折</p>
} else {
<p style="font-size: 35px;color:#FFFF00;">@package.Name 9 折</p>
}
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<p>@package.Profile</p>
</div>
@@ -262,7 +266,11 @@
<a asp-action="buy" asp-controller="product" asp-route-id="@package.Id">
<div class="card color_@((item.Packages.IndexOf(package)+1)%5)">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name 八折</p>
@if(package.Title != ""){
<p style="font-size: 35px;color:#FFFF00;">@package.Name @package.Title 折</p>
} else {
<p style="font-size: 35px;color:#FFFF00;">@package.Name 8 折</p>
}
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<p>@package.Profile</p>
</div>

View File

@@ -30,7 +30,7 @@
<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>
<h1>总消费满<span style="color: red;font-size:49px;">200</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>

View File

@@ -678,12 +678,15 @@
<div style="font-size: 15px;">
<h3 style="margin-top: 0px;margin-bottom: 10px;display:inline;color:red;background-color:#FFFF00;">公告</h3><a style="cursor:pointer;display:inline;float:right;" onclick="know()">X</a>
<h4 style="margin-top: 10px;">老鹰IP已恢复运营已更新最新的IP池产品稳定性也做了大幅度的升级</h4>
<h4>老鹰IP已加入8折助攻计划月卡仅需54元量大价更低</h4>
<h4 style="margin-top: 10px;">聚IP官网已更新为自动更改折扣优惠价</h4>
<p>总消费超过200自动升级为白银9折</p>
<p>总消费超过500自动升级为黄金8折</p>
<p>...</p>
<p>几乎所有用户在此次自动更新后优惠都变的更大了,可能出现个别用户价格比之前的高,可联系客服帮您更改手动更改折扣。</p>
<p>如果您对价格有疑问也可联系客服帮您更改折扣!</p>
<p>如果您有更大用量或销量,可咨询客服获取更低的折扣!</p>
<p>1.动态IP一毛钱一天每用户限一次。</p>
<p>2.复工季聚IP助力开工全部产品所有套餐8折狂欢价月卡低至50多量大价更低</p>
<p>3.月卡送10天双月卡送一个月部分产品参加。</p>
<p>4.新上老鹰IP蘑菇IP西瓜IP新上安卓APP。</p>
</div>
<p >

View File

@@ -173,7 +173,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送十天";
content: "8 折+送十天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -203,7 +203,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送一月";
content: "7 折+送一月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -262,7 +262,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送一个月";
content: "8 折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -291,7 +291,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送七天";
content: "9 折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -320,7 +320,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送一个月";
content: "8 折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -349,7 +349,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送两个月";
content: "8 折+送两个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -379,7 +379,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送七天";
content: "8 折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -409,7 +409,8 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折";
content: "9折";
@* content: "@Model[0].Packages[0].Title 折"; *@
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -437,7 +438,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折";
content: "8 折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -490,7 +491,7 @@
<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>
<h3>总消费满<span style="color: red;font-size:49px;">200</span>元,即可享受超值优惠价</h3>
<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>
@@ -627,9 +628,42 @@
@foreach (var package in item.Packages.Where(m => m.IsTest == 0 && m.Status == 1).OrderBy(m => m.TenantId))
{
<style>
.packageitem-@package.Id{
position: relative;
}
.packageitem-@package.Id::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "@package.Title 折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem-@package.Id::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
</style>
@if(package.Price == 0.1M){
<div class="item packageitem packageitem1" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
@@ -643,7 +677,7 @@
}
else if(package.Id == 1018||package.Id==1009||package.Id==1019){
<div class="item packageitem packageitem91" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
@@ -655,37 +689,10 @@
<img src="~/img/check.png" class="cardCheck">
</div>
}
@* else if(package.Id==1020){
<div class="item packageitem packageitem92" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka" style="font-size:17px;">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} *@
@* else if(package.Id==1021){
<div class="item packageitem packageitem8-1" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka" style="font-size:17px;">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} *@
else if(package.Id == 88||package.Id == 101||package.Id == 103){
<div class="item packageitem packageitem86" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
@@ -697,24 +704,10 @@
<img src="~/img/check.png" class="cardCheck">
</div>
}
@* else if(package.Id == 34){
<div class="item packageitem packageitem10" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka" style="font-size:17px;">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} *@
else if(package.Id==105){
<div class="item packageitem packageitem710" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
@@ -726,8 +719,8 @@
</div>
}
else if(package.Id == 100||package.Id == 102) {
<div class="item packageitem packageitem19" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
@@ -740,8 +733,8 @@
}
else if(package.Id == 1007||package.Id == 1008||package.Id == 104) {
<div class="item packageitem packageitem81" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
@@ -753,37 +746,12 @@
</div>
}
@* else if(package.Id == 63||package.Id == 64||package.Id == 65||package.Id == 66||package.Id == 67||package.Id == 13||package.Id == 14||package.Id == 15||package.Id == 16) {
<div class="item packageitem packageitem4" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka" style="font-size:17px;">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} *@
@* else if(package.Id == 71||package.Id == 100||package.Id == 102) {
<div class="item packageitem packageitem71" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka" style="font-size:17px;">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} *@
else if(package.Id == 1||package.Id == 1002||package.Id == 4||package.Id == 7||package.Id == 12||package.Id == 17||package.Id == 22||package.Id == 27||package.Id == 32||package.Id == 37||package.Id == 42||package.Id == 62||package.Id == 69||package.Id == 73||package.Id == 80) {
<div class="item packageitem packageitem71" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
@@ -798,7 +766,8 @@
}
else {
<div class="item packageitem packageitem4" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
@if((package.Id == 64||package.Id == 1004)&&package.Price<60){
<p><span class="price">60.00</span>元</p>
@@ -820,7 +789,7 @@
</div>
<div style="margin-left:26%">
<div style="border: 1px dashed #ccc;margin-top:30px;width:50%;margin-left: 63px;background-color:#FFCC33">
<p class="youhuiNew" style="padding-bottom:0px;">温馨提示需求5个以上可以联系客服设置优惠价</p>
<p class="youhuiNew" style="padding-bottom:0px;">总消费满200元即可享受超值优惠价</p>
<p class="youhuiNew" style="padding-top:0px;padding-bottom:0px;">开通后有任何问题可无理由退款,并支持自助提现</p>
</div>

View File

@@ -65,7 +65,7 @@
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem10{
position: relative;
}
@@ -81,7 +81,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "免费送十天";
content: "8 折+送十天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -111,7 +111,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送一月";
content: "7 折+送一月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -126,6 +126,64 @@
}
.packageitem1{
position: relative;
}
.packageitem1::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: #FF0033;
height: 0px;
border: 1.0rem solid #FF9933;
border-right-color: transparent;
content: "首单0.1元";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem1::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem81{
position: relative;
}
.packageitem81::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "8 折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem81::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem19{
position: relative;
}
@@ -141,7 +199,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "免费送十天";
content: "9 折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -155,65 +213,7 @@
border-bottom-color: transparent;
}
.packageitem3{
position: relative;
}
.packageitem71{
position: relative;
}
.packageitem71::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem71::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem3::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "九折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem3::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem91{
.packageitem91{
position: relative;
}
.packageitem91::before {
@@ -228,7 +228,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折+送一个月";
content: "8 折+送一个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -242,7 +242,96 @@
border-bottom-color: transparent;
}
.packageitem4{
.packageitem92{
position: relative;
}
.packageitem92::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "8 折+送两个月";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem92.contentNew::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem8-1{
position: relative;
}
.packageitem8-1::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "8 折+送七天";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem8-1.contentNew::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem71{
position: relative;
}
.packageitem71::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "9折";
@* content: "@Model[0].Packages[0].Title 折"; *@
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem71::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
.packageitem4{
position: relative;
}
.packageitem4::before {
@@ -257,7 +346,7 @@
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "折";
content: "8 折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
@@ -271,6 +360,7 @@
border-bottom-color: transparent;
}
</style>
<!-- ad -->
@* <div class="container-fluid ad">
@@ -280,7 +370,7 @@
<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>
<h3>总消费满<span style="color: red;font-size:49px;">200</span>元,即可享受超值优惠价</h3>
<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>
@@ -313,7 +403,7 @@
</div>
</div>
</div>
<p class="youhuiNew" style="padding:0;margin:0;color:white;background-color:#FF0033;">一毛钱活动:不分新老用户都可参加!</p>
<p class="youhuiNew" style="padding:0;margin:10px;color:white;background-color:#FF0033;">一毛钱活动:不分新老用户都可参加!</p>
@* @if(defaultProduct.Id == 5){
<p class="youhuiNew">月卡赠送10天双月卡赠送1个月新开和续费都有赠送活动截止时间2020年11月25日。<br>同一个IP账号仅限一次每位会员不限账号数量您可购买多个IP账号都有赠送</p>
} *@
@@ -357,10 +447,40 @@
<div style="display: flex;margin: 0 auto;">
@foreach (var package in Model.Packages.Where(m => m.IsTest == 0 && m.Status == 1&& m.Id != 1009&& m.Id != 1018&& m.Id != 1019).OrderBy(m => m.TenantId))
{
<style>
.packageitem-@package.Id{
position: relative;
}
.packageitem-@package.Id::before {
position: absolute;
top: 0.3rem;
left: -0.5rem;
z-index: 1;
padding-right: 0.625rem;
font-weight: bold;
line-height: 0px;
color: white;
height: 0px;
border: 1.2rem solid #f64e3d;
border-right-color: transparent;
content: "@package.Title 折";
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
}
.packageitem-@package.Id::after {
content: "";
position: absolute;
top: 2.1875rem;
left: -0.5rem;
border: 0.25rem solid #f64e3d;
border-left-color: transparent;
border-bottom-color: transparent;
}
</style>
@if(package.Id == 88||package.Id == 101||package.Id == 103){
<div class="item packageitem packageitem86" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
@@ -374,7 +494,8 @@
else if(package.Id == 1018){
<div class="item packageitem packageitem91" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
@@ -402,7 +523,8 @@
} *@
else if(package.Id==105){
<div class="item packageitem packageitem710" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
@@ -443,8 +565,8 @@
} *@
else if(package.Id == 1||package.Id == 1002||package.Id == 1003||package.Id == 4||package.Id == 7||package.Id == 12||package.Id == 17||package.Id == 22||package.Id == 27||package.Id == 32||package.Id == 37||package.Id == 42||package.Id == 62||package.Id == 69||package.Id == 73||package.Id == 80) {
<div class="item packageitem packageitem71" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
@@ -457,8 +579,8 @@
} else if(package.Id != 88) {
<div class="item packageitem packageitem4" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<div class="item packageitem packageitem-@package.Id" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
@if((package.Id == 64||package.Id == 1004)&&package.Price<60){
<p><span class="price">60.00</span>元</p>
} else {
@@ -488,7 +610,7 @@
</div></div>
<div style="margin-left:26%">
<div style="border: 1px dashed #ccc;margin-top:30px;width:50%;margin-left: 63px;background-color:#FFCC33">
<p class="youhuiNew" style="padding-bottom:0px;">温馨提示需求5个以上可以联系客服设置优惠价</p>
<p class="youhuiNew" style="padding-bottom:0px;">总消费满200元即可享受超值优惠价</p>
<p class="youhuiNew" style="padding-top:0px;padding-bottom:0px;">开通后有任何问题可无理由退款,并支持自助提现</p>
</div>

View File

@@ -60,6 +60,7 @@ namespace Hncore.Pass.Vpn.Controllers
var entity = await m_PriceSchemeService.GetById(request.Id);
entity.Name = request.Name;
entity.Remark = request.Remark;
entity.discount = request.discount;
entity.UpdateTime = DateTime.Now;
await m_PriceSchemeService.Update(entity);
return Success();

View File

@@ -16,6 +16,7 @@ namespace Hncore.Pass.Vpn.Domain
public string username { get; set; }
public string realname { get; set; }
public int discount_id { get; set; }
public string phone { get; set; }

View File

@@ -8,6 +8,7 @@ namespace Hncore.Pass.Vpn.Domain
{
public string Name { get; set; }
public string Remark { get; set; }
public int discount { get; set; }
}
}

View File

@@ -19,6 +19,8 @@ namespace Hncore.Pass.Vpn.Domain
/// 登录密码[20]
/// </summary>
public string Password { get; set; }
public int discount_id { get; set; }
/// <summary>
/// 微信昵称
@@ -51,6 +53,7 @@ namespace Hncore.Pass.Vpn.Domain
/// 是否主管理员权限
/// </summary>
public DateTime? LastLoginDate { get; set; } = DateTime.Now;
public string pay_time { get; set; }
public int Sex { get; set; }

View File

@@ -39,9 +39,11 @@ namespace Hncore.Pass.Vpn.Service
AgentUserService m_AgentUserService;
AgentScoreService m_AgentScoreService;
AgentPriceService m_AgentPriceService;
ProductPriceSchemeService m_ProductPriceSchemeService;
public ProductOrderService(CourseContext dbContext
, AgentUserService _AgentUserService
, AgentScoreService _AgentScoreService
, ProductPriceSchemeService _ProductPriceSchemeService
, AgentPriceService _AgentPriceService
, ProductService _ProductService
, ProductPackageService _ProductPackageService
@@ -56,6 +58,7 @@ namespace Hncore.Pass.Vpn.Service
{
m_DbContext = dbContext;
m_AgentUserService = _AgentUserService;
m_ProductPriceSchemeService = _ProductPriceSchemeService;
m_AgentScoreService = _AgentScoreService;
m_AgentPriceService = _AgentPriceService;
m_ProductService = _ProductService;
@@ -258,12 +261,34 @@ 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;
var dis_price = 1000000M;
if(userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)){
//根据折扣设置价格
var discount = await m_ProductPriceSchemeService.GetById(userEntity.discount_id);
if (discount != null)
{
dis_price = packageEntity.LinePrice * discount.discount / 100;
is_user_price = false;
}
} else {
//根据会员价
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)
{
dis_price = userPrice.UserPrice;
is_user_price = false;
}
}
if(dis_price<price){
price = dis_price;
}
if(price<packageEntity.MinPrice){
price = packageEntity.MinPrice;
}
if (ProductAccountCount == 0 && request.OrderType != OrderType.News && packageEntity.DayCount == 1 && request.ConnectCount == 1 && request.OrderType!=OrderType.AgainBuy&& request.OrderType!=OrderType.AgainBuys){
price = 0.1M;
@@ -739,11 +764,25 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
}
}
}
var userEntity = await m_UserService.GetById(order.UserId);
if(order.agent_id != 0 && order.PaymentAmount != 0.1M){
var agentEntity = await m_AgentUserService.Query(m => m.id == order.agent_id).FirstOrDefaultAsync();
var agentPriceEntity = await m_AgentPriceService.Query(m => m.agent_id == order.agent_id && m.package_id == order.PackageId).FirstOrDefaultAsync();
var score_money = order.PaymentAmount - order.ConnectCount * order.AccountCount * agentPriceEntity.price;
//根据折扣设置价格
var score_money = 0.00M;
if(userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)){
//获取代理折扣
var discount = await m_ProductPriceSchemeService.GetById(agentEntity.discount_id);
var packageEntity = await m_ProductPackageService.GetById(order.PackageId);
var price = packageEntity.LinePrice * discount.discount / 100;
score_money = order.PaymentAmount - order.ConnectCount * order.AccountCount * price;
} else {
var agentPriceEntity = await m_AgentPriceService.Query(m => m.agent_id == order.agent_id && m.package_id == order.PackageId).FirstOrDefaultAsync();
score_money = order.PaymentAmount - order.ConnectCount * order.AccountCount * agentPriceEntity.price;
}
var agnetScoreEntity = new AgentScoreEntity()
{
@@ -764,6 +803,26 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
await m_AgentUserService.Update(agentEntity);
}
userEntity.pay_time = DateTime.Now.ToString();
userEntity.ConsumeAmount += order.PaymentAmount;
//折扣设置
var user_discount_id = userEntity.discount_id;
if (userEntity.ConsumeAmount>=200 && userEntity.ConsumeAmount<500){
userEntity.discount_id = 1;
} else if(userEntity.ConsumeAmount>=500 && userEntity.ConsumeAmount<1500) {
userEntity.discount_id = 2;
} else if(userEntity.ConsumeAmount>=1500 && userEntity.ConsumeAmount<3000) {
userEntity.discount_id = 4;
} else if(userEntity.ConsumeAmount>=3000 && userEntity.ConsumeAmount<6000) {
userEntity.discount_id = 5;
} else if(userEntity.ConsumeAmount>=6000) {
userEntity.discount_id = 6;
}
if(userEntity.discount_id !=0 && userEntity.discount_id>user_discount_id && userEntity.agent_id!=0){
await m_UserService.Update(userEntity);
}
}
@@ -894,15 +953,35 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
}
var product = await this.m_ProductService.GetById(pacageInfo.ProductId);
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
//折扣
var refundDayPrice = 10.00M;
var userEntity = await m_UserService.GetById(userId);
if(userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)){
//获取代理折扣
var discount = await m_ProductPriceSchemeService.GetById(userEntity.discount_id);
refundDayPrice = (product.RefundDayPrice * discount.discount / 100).ToDecimal();
} else {
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
var refundDayPrice = userPrice != null && userPrice.RefundDayPrice > 0 ? userPrice.RefundDayPrice : product.RefundDayPrice;
refundDayPrice = (userPrice != null && userPrice.RefundDayPrice > 0 ? userPrice.RefundDayPrice : product.RefundDayPrice).ToDecimal();
}
Console.WriteLine("=====================================================");
Console.WriteLine(refundDayPrice);
Console.WriteLine("=====================================================");
var lastOrder = await GetLastOrderByAccount(account);
var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays);
var refundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice.Value * accountInfo.ConnectCount;
var refundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice * accountInfo.ConnectCount;
refundAmount = refundAmount <= 0 ? 0 : refundAmount;
//退款用户总消费修改
userEntity.ConsumeAmount -= refundAmount;
await m_UserService.Update(userEntity);
var order = new ProductOrderEntity()
{
AccountCount = 1,
@@ -958,15 +1037,25 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
if(order.agent_id != 0 ){
var agentEntity = await m_AgentUserService.Query(m => m.id == order.agent_id).FirstOrDefaultAsync();
var agentPriceEntity = await m_AgentPriceService.Query(m => m.agent_id == order.agent_id && m.package_id == order.PackageId).FirstOrDefaultAsync();
var agentScoreEntity = await m_AgentScoreService.Query(m => m.agent_id == order.agent_id && m.order_id == lastOrder.Id).FirstOrDefaultAsync();
var deduct_money = agentScoreEntity.score_value / lastOrder.AccountCount;
//
//使用天数 回补佣金
var re_money = useDay * (refundDayPrice.Value - agentPriceEntity.refund) * accountInfo.ConnectCount;
var re_money = 0.00M;
if(userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)){
//获取代理折扣
var discount = await m_ProductPriceSchemeService.GetById(agentEntity.discount_id);
re_money = useDay * (refundDayPrice - (product.RefundDayPrice).ToDecimal() * discount.discount / 100) * accountInfo.ConnectCount;
} else {
var agentPriceEntity = await m_AgentPriceService.Query(m => m.agent_id == order.agent_id && m.package_id == order.PackageId).FirstOrDefaultAsync();
//使用天数 回补佣金
re_money = useDay * (refundDayPrice - agentPriceEntity.refund) * accountInfo.ConnectCount;
}
//佣金
var score_money = agentEntity.account - deduct_money + re_money;
@@ -1017,13 +1106,24 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
}
var product = await this.m_ProductService.GetById(pacageInfo.ProductId);
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
var refundDayPrice = userPrice == null ? product.RefundDayPrice : userPrice.RefundDayPrice;
//折扣
var refundDayPrice = 10.00M;
var userEntity = await m_UserService.GetById(userId);
if(userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)){
//获取代理折扣
var discount = await m_ProductPriceSchemeService.GetById(userEntity.discount_id);
refundDayPrice = (product.RefundDayPrice * discount.discount / 100).ToDecimal();
} else {
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
refundDayPrice = (userPrice != null && userPrice.RefundDayPrice > 0 ? userPrice.RefundDayPrice : product.RefundDayPrice).ToDecimal();
}
var lastOrder = await GetLastOrderByAccount(account);
var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays);
var RefundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice.Value * accountInfo.ConnectCount;
var RefundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice * accountInfo.ConnectCount;
RefundAmount = RefundAmount <= 0 ? 0 : RefundAmount;
var time = (lastOrder.EndTime - DateTime.Now).Value;