修改代理返款规则
This commit is contained in:
@@ -280,7 +280,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="tixing">*手机号不是IP账号,请登录后开通IP账号*</p>
|
<p class="tixing">*手机号不是IP账号,请登录后开通IP账号*</p>
|
||||||
<p class="denglu"><button type="button" class="btn btn-login" onclick="login()">登录</button></p>
|
<p class="denglu"><a type="button" class="btn btn-login" href="/User/WebLogin">登录</a></p>
|
||||||
<p class="zhiyin grayText">还没有账号?<a href="#" class="regLink">立即注册</a></p>
|
<p class="zhiyin grayText">还没有账号?<a href="#" class="regLink">立即注册</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -378,8 +378,8 @@
|
|||||||
<li>
|
<li>
|
||||||
@if (user == null)
|
@if (user == null)
|
||||||
{
|
{
|
||||||
<button type="button" class="btn btn-warning reg">注册</button>
|
<a type="button" style="display:inline;" class="btn btn-warning reg">注册</a>
|
||||||
<button type="button" class="btn btn-danger login">登录</button>
|
<a style="display:inline;" type="button" href="/User/WebLogin" class="btn btn-danger login">登录</a>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -858,6 +858,9 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
|||||||
var discount = await m_ProductPriceSchemeService.GetById(agentEntity.discount_id);
|
var discount = await m_ProductPriceSchemeService.GetById(agentEntity.discount_id);
|
||||||
var packageEntity = await m_ProductPackageService.GetById(order.PackageId);
|
var packageEntity = await m_ProductPackageService.GetById(order.PackageId);
|
||||||
var price = packageEntity.LinePrice * discount.discount / 100;
|
var price = packageEntity.LinePrice * discount.discount / 100;
|
||||||
|
if (price < packageEntity.MinPrice) {
|
||||||
|
price = packageEntity.MinPrice;
|
||||||
|
}
|
||||||
score_money = order.PaymentAmount - order.ConnectCount * order.AccountCount * price;
|
score_money = order.PaymentAmount - order.ConnectCount * order.AccountCount * price;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1076,48 +1079,48 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(order.agent_id != 0 && order.PaymentAmount != 0.1M){
|
// if(order.agent_id != 0 && order.PaymentAmount != 0.1M){
|
||||||
var agentEntity = await m_AgentUserService.Query(m => m.id == order.agent_id).FirstOrDefaultAsync();
|
// var agentEntity = await m_AgentUserService.Query(m => m.id == order.agent_id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
//根据折扣设置价格
|
// //根据折扣设置价格
|
||||||
var score_money = 0.00M;
|
// var score_money = 0.00M;
|
||||||
// if((userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)) && userEntity.discount_id >= 0){
|
// // if((userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_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;
|
||||||
|
// // }
|
||||||
|
// if(agentEntity.discount_id != 0){
|
||||||
// //获取代理折扣
|
// //获取代理折扣
|
||||||
// var discount = await m_ProductPriceSchemeService.GetById(agentEntity.discount_id);
|
// var discount = await m_ProductPriceSchemeService.GetById(agentEntity.discount_id);
|
||||||
// var packageEntity = await m_ProductPackageService.GetById(order.PackageId);
|
// var packageEntity = await m_ProductPackageService.GetById(order.PackageId);
|
||||||
// var price = packageEntity.LinePrice * discount.discount / 100;
|
// var price = packageEntity.LinePrice * discount.discount / 100;
|
||||||
// score_money = order.PaymentAmount - order.ConnectCount * order.AccountCount * price;
|
// 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;
|
|
||||||
// }
|
// }
|
||||||
if(agentEntity.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var agnetScoreEntity = new AgentScoreEntity()
|
// var agnetScoreEntity = new AgentScoreEntity()
|
||||||
{
|
// {
|
||||||
agent_id = order.agent_id,
|
// agent_id = order.agent_id,
|
||||||
order_id = order.Id,
|
// order_id = order.Id,
|
||||||
score_type = 1,
|
// score_type = 1,
|
||||||
score_value = score_money,
|
// score_value = score_money,
|
||||||
remark = "客户购买产品" + order.Accounts,
|
// remark = "客户购买产品" + order.Accounts,
|
||||||
agent_name = agentEntity.username,
|
// agent_name = agentEntity.username,
|
||||||
op_user = order.UserName,
|
// op_user = order.UserName,
|
||||||
rest_amount1 = agentEntity.account,
|
// rest_amount1 = agentEntity.account,
|
||||||
rest_amount2 = agentEntity.account + score_money
|
// rest_amount2 = agentEntity.account + score_money
|
||||||
};
|
// };
|
||||||
|
|
||||||
agentEntity.account += score_money;
|
// agentEntity.account += score_money;
|
||||||
|
|
||||||
await m_AgentScoreService.Add(agnetScoreEntity);
|
// await m_AgentScoreService.Add(agnetScoreEntity);
|
||||||
await m_AgentUserService.Update(agentEntity);
|
// await m_AgentUserService.Update(agentEntity);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user