一毛钱活动

This commit is contained in:
“wanyongkang”
2021-01-18 17:57:11 +08:00
parent e6171147c4
commit c0b77c96df
6 changed files with 110 additions and 8 deletions

View File

@@ -82,8 +82,12 @@ namespace Home.Controllers
var userInfo = this.Request.GetUserInfo();
if (userInfo != null)
{
//从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 => {
@@ -93,6 +97,18 @@ namespace Home.Controllers
{
m.Price = userPrice.UserPrice;
}
if (ProductAccountCount == 0 && m.DayCount == 1 && m.ProductId!=5){
m.Price = 0.1M;
}
});
}
} else {
foreach(var product in respList)
{
product.Packages.ForEach(m => {
if ( m.DayCount == 1 && m.ProductId!=5){
m.Price = 0.1M;
}
});
}
}
@@ -656,11 +672,18 @@ namespace Home.Controllers
var package = await m_ProductPackageService.GetById(id);
var product = await m_ProductService.GetById(package.ProductId);
//从user表获取用户信息
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;
}
if (ProductAccountCount == 0 && package.DayCount == 1 && package.ProductId!=5){
package.Price = 0.1M;
}
return View("buy", new PackageInfoResponse()
{