购买自动升级折扣
This commit is contained in:
@@ -253,6 +253,8 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "链接数至少为1!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//是否已经设置会员价
|
||||
var is_user_price = true;
|
||||
@@ -267,7 +269,57 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
if (discount != null)
|
||||
{
|
||||
dis_price = packageEntity.LinePrice * discount.discount / 100;
|
||||
is_user_price = false;
|
||||
if(discount.discount < 65){
|
||||
is_user_price = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(userEntity.agent_id == 0){
|
||||
|
||||
var cost_price = price;
|
||||
if(cost_price > dis_price){
|
||||
cost_price = dis_price;
|
||||
}
|
||||
|
||||
//自动使用折扣
|
||||
var cost = 0M;
|
||||
if (request.OrderType == OrderType.New || request.OrderType == OrderType.AgainBuy)
|
||||
{
|
||||
cost = cost_price * request.ConnectCount;
|
||||
}
|
||||
|
||||
if (request.OrderType == OrderType.News)
|
||||
{
|
||||
var accounts = GreateBatchAccount(request.Account, request.MinPostfix, request.MaxPostfix);
|
||||
cost = cost_price * request.ConnectCount * accounts.Count;
|
||||
}
|
||||
|
||||
if (request.OrderType == OrderType.AgainBuys)
|
||||
{
|
||||
int count = request.Account.Split(",").Length;
|
||||
cost = cost_price * request.ConnectCount * count;
|
||||
}
|
||||
var cost_money = cost + userEntity.ConsumeAmount;
|
||||
var discount_reset = 100;
|
||||
if (cost_money>=200 && cost_money<500){
|
||||
discount_reset = 90;
|
||||
} else if(cost_money>=500 && cost_money<1500) {
|
||||
discount_reset = 80;
|
||||
} else if(cost_money>=1500 && cost_money<3000) {
|
||||
discount_reset = 70;
|
||||
} else if(cost_money>=3000 && cost_money<6000) {
|
||||
discount_reset = 65;
|
||||
} else if(cost_money>=6000) {
|
||||
discount_reset = 60;
|
||||
}
|
||||
if (discount != null)
|
||||
{
|
||||
if(discount_reset<discount.discount){
|
||||
dis_price = packageEntity.LinePrice * discount_reset / 100;
|
||||
}
|
||||
} else {
|
||||
dis_price = packageEntity.LinePrice * discount_reset / 100;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//根据会员价
|
||||
@@ -278,9 +330,12 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
is_user_price = false;
|
||||
}
|
||||
}
|
||||
|
||||
//确定价格
|
||||
if(dis_price<price){
|
||||
price = dis_price;
|
||||
}
|
||||
//最低价
|
||||
if(price<packageEntity.MinPrice){
|
||||
price = packageEntity.MinPrice;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user