Commit 109fdae5 authored by liudong1993's avatar liudong1993

1

parent ca52ab5f
......@@ -1981,6 +1981,8 @@ namespace Mall.Module.User
{
//所有未提现的 返佣
var clist = goods_OrderCommissionRepository.GetUserCommissionRemit(remitModel.UserId ?? 0);
if (clist.Any())
{
//获取订单列表
string OrderIds = string.Join(",", clist.Select(x => x.OrderId).Distinct());
var olist = goods_OrderRepository.GetOrderList(new RB_Goods_Order_Extend() { OrderIds = OrderIds });
......@@ -1998,7 +2000,7 @@ namespace Mall.Module.User
foreach (var qitem in chlist)
{
TMoney -= (qitem.Commission ?? 0);
CommMoney+= (qitem.Commission ?? 0);
CommMoney += (qitem.Commission ?? 0);
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderCommission_Extend.IsRemit),1}
};
......@@ -2040,6 +2042,7 @@ namespace Mall.Module.User
distributor_RemitRepository.Update(keyValues1, wheres1);
}
}
}
#endregion
//提现审核通过 自动生成财务单据
......@@ -3214,6 +3217,8 @@ namespace Mall.Module.User
if (demodel.TenantId == 1) {
//所有未提现的 返佣
var clist = goods_OrderCommissionRepository.GetUserCommissionRemit(demodel.UserId ?? 0);
if (clist.Any())
{
//获取订单列表
string OrderIds = string.Join(",", clist.Select(x => x.OrderId).Distinct());
var olist = goods_OrderRepository.GetOrderList(new RB_Goods_Order_Extend() { OrderIds = OrderIds });
......@@ -3222,7 +3227,8 @@ namespace Mall.Module.User
string OrderNos = "";
decimal TMoney = (demodel.AppliedMoney ?? 0);
//开始递减金额 订单不足的 给与提示
foreach (var item in olist) {
foreach (var item in olist)
{
if (TMoney > 0)
{
decimal CommMoney = 0;
......@@ -3247,14 +3253,17 @@ namespace Mall.Module.User
OrderIdList.Add(item.OrderId);
}
}
if (!string.IsNullOrEmpty(OrderNos)) {
if (!string.IsNullOrEmpty(OrderNos))
{
OrderNos = OrderNos[0..^1];
}
if (TMoney > 0) {
if (TMoney > 0)
{
OrderNos += " 余额" + TMoney + "尚未找到相关订单";
}
if (!string.IsNullOrEmpty(OrderNos)) {
if (!string.IsNullOrEmpty(OrderNos))
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Distributor_Remit_Extend.ReOrderNos),OrderNos},
{ nameof(RB_Distributor_Remit_Extend.ReOrderIds),JsonConvert.SerializeObject(OrderIdList)},
......@@ -3269,6 +3278,7 @@ namespace Mall.Module.User
distributor_RemitRepository.Update(keyValues1, wheres1, trans);
}
}
}
#endregion
}
distributor_RemitRepository.DBSession.Commit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment