设置价格 折扣
This commit is contained in:
@@ -109,12 +109,12 @@ namespace Home.Controllers
|
||||
} else {
|
||||
m.Title = "9";
|
||||
}
|
||||
if (ProductAccountCount == 0 && m.DayCount == 1){
|
||||
m.Price = 0.1M;
|
||||
}
|
||||
if(m.Price<m.MinPrice){
|
||||
m.Price = m.MinPrice;
|
||||
}
|
||||
if (ProductAccountCount == 0 && m.DayCount == 1){
|
||||
m.Price = 0.1M;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -731,13 +731,13 @@ namespace Home.Controllers
|
||||
if(dis_price<package.Price){
|
||||
package.Price = dis_price;
|
||||
}
|
||||
if(package.Price<package.MinPrice){
|
||||
package.Price = package.MinPrice;
|
||||
}
|
||||
|
||||
if (ProductAccountCount == 0 && package.DayCount == 1){
|
||||
package.Price = 0.1M;
|
||||
}
|
||||
if(package.Price<package.MinPrice){
|
||||
package.Price = package.MinPrice;
|
||||
}
|
||||
|
||||
return View("buy", new PackageInfoResponse()
|
||||
{
|
||||
|
||||
@@ -248,9 +248,6 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
{
|
||||
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "请前往实名认证");
|
||||
}
|
||||
// Console.WriteLine("==========================================================================");
|
||||
// Console.WriteLine(request.ConnectCount);
|
||||
// Console.WriteLine("==========================================================================");
|
||||
|
||||
if (request.ConnectCount<=0){
|
||||
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "链接数至少为1!");
|
||||
@@ -803,26 +800,27 @@ 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);
|
||||
}
|
||||
// userEntity.pay_time = DateTime.Now.ToString();
|
||||
// userEntity.ConsumeAmount += order.PaymentAmount;
|
||||
|
||||
// //折扣设置
|
||||
// var user_discount_id = userEntity.discount_id;
|
||||
// var new_discount_id = 0;
|
||||
// if (userEntity.ConsumeAmount>=200 && userEntity.ConsumeAmount<500){
|
||||
// new_discount_id = 1;
|
||||
// } else if(userEntity.ConsumeAmount>=500 && userEntity.ConsumeAmount<1500) {
|
||||
// new_discount_id = 2;
|
||||
// } else if(userEntity.ConsumeAmount>=1500 && userEntity.ConsumeAmount<3000) {
|
||||
// new_discount_id = 4;
|
||||
// } else if(userEntity.ConsumeAmount>=3000 && userEntity.ConsumeAmount<6000) {
|
||||
// new_discount_id = 5;
|
||||
// } else if(userEntity.ConsumeAmount>=6000) {
|
||||
// new_discount_id = 6;
|
||||
// }
|
||||
// //新折扣大于老折扣,且不为代理用户
|
||||
// if(new_discount_id>user_discount_id && userEntity.agent_id==0){
|
||||
// userEntity.discount_id = new_discount_id;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -959,16 +957,17 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
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();
|
||||
if (discount != null){
|
||||
refundDayPrice = (product.RefundDayPrice * discount.discount / 100).ToDecimal();
|
||||
} else {
|
||||
refundDayPrice = (product.RefundDayPrice).ToDecimal();
|
||||
}
|
||||
} else {
|
||||
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
|
||||
|
||||
refundDayPrice = (userPrice != null && userPrice.RefundDayPrice > 0 ? userPrice.RefundDayPrice : product.RefundDayPrice).ToDecimal();
|
||||
}
|
||||
|
||||
Console.WriteLine("=====================================================");
|
||||
Console.WriteLine(refundDayPrice);
|
||||
Console.WriteLine("=====================================================");
|
||||
|
||||
|
||||
|
||||
@@ -1114,7 +1113,11 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
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();
|
||||
if (discount != null){
|
||||
refundDayPrice = (product.RefundDayPrice * discount.discount / 100).ToDecimal();
|
||||
} else {
|
||||
refundDayPrice = (product.RefundDayPrice).ToDecimal();
|
||||
}
|
||||
} else {
|
||||
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user