Commit e8e6b2f1 authored by 吴春's avatar 吴春

提交代码

parent 976be710
......@@ -6379,14 +6379,14 @@ namespace Mall.Module.User
}
//已提现佣金 //未结算佣金
var commModel = distributor_RemitRepository.GetDistributorCommissionStatiscs(userInfo.UserId);
var commModel = smallShopsRemitRepository.GetDistributorCommissionStatiscs(userInfo.UserId);
//提现总额
var remitMoney = distributor_RemitRepository.GetDistributorRemitCommission(userInfo.UserId);
var remitMoney = smallShopsRemitRepository.GetDistributorRemitCommission(userInfo.UserId);
//分销订单
decimal OrderCommission = smallShopsCommissionRepository.GetUserOrderCommissionStatistics(userInfo.UserId);
//未结算返佣
decimal WJSCommission = goods_OrderCommissionRepository.GetUserOrderCommissionNoSettlement(userInfo.UserId);
decimal WJSCommission = smallShopsCommissionRepository.GetSmallShopsCommissionNoSettlement(userInfo.UserId);
......
......@@ -193,6 +193,28 @@ left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and o
return 0;
}
/// <summary>
/// 用户未结算返佣
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public decimal GetSmallShopsCommissionNoSettlement(int userId)
{
string sql = $@"SELECT SUM(Commission) as Commission FROM RB_SmallShops_Commission oc
INNER JOIN rb_goods_order o on oc.OrderId=o.OrderId
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
WHERE oc.UserId={userId} and oc.CommissionState=1 and o.OrderStatus in (1,2,3,4,5,6) and o.Recycled=2 and oa.ReOrderId is null";
var obj = ExecuteScalar(sql);
if (obj != null)
{
return Convert.ToDecimal(obj);
}
return 0;
}
/// <summary>
/// 获取未提现的佣金列表
/// </summary>
......
......@@ -87,10 +87,20 @@ where {where} order by di.CreateDate desc";
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)}={dmodel.UserId}";
}
//if (dmodel.IsSelectAuditStatus == 1)
//{
// if (dmodel.AuditStatus > 0)
// {
// where += $@" and di.{nameof(RB_SmallShops_Info_Extend.AuditStatus)} in(1,2)";
// }
//}
//else {
if (dmodel.AuditStatus > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.AuditStatus)}={(int)dmodel.AuditStatus}";
}
// }
if (dmodel.GradeId >= 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.GradeId)}={dmodel.GradeId}";
......
......@@ -1183,7 +1183,7 @@ namespace Mall.WebApi.Controllers.User
var userInfo = AppletUserInfo;
JObject prams = JObject.Parse(req.msg.ToString());
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
var createDateStr = prams.GetStringValue("CreateDate")+"-01";
var createDateStr = prams.GetStringValue("CreateDate") + "-01";
RB_Member_Balance_Extend demodel = new RB_Member_Balance_Extend();
if (!string.IsNullOrWhiteSpace(createDateStr))
{
......@@ -1785,6 +1785,17 @@ namespace Mall.WebApi.Controllers.User
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_SmallShops_Info_Extend demodel = JsonConvert.DeserializeObject<RB_SmallShops_Info_Extend>(req.msg.ToString());
var memberModel = userModule.GetMemberUserInfo(userInfo.UserId);
if (memberModel == null)
{
return ApiResult.Failed("用户信息不存在");
}
if (memberModel.SmallShopId > 0)
{
return ApiResult.Failed("当前不满足申请资格,请联系客服");
}
//判断是否满足当前申请条件
var microShopBasics = MallBaseModule.GetMicroShopBasicsList(new Model.Entity.BaseSetUp.RB_MicroShop_Basics { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
......@@ -1855,6 +1866,10 @@ namespace Mall.WebApi.Controllers.User
demodel.MallBaseId = userInfo.MallBaseId;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
demodel.TotalCommission = 0;
demodel.Commission = 0;
demodel.UpPrice = 0;
demodel.PriceType = 0;
demodel.Status = 0;
demodel.AuditStatus = microShopBasics.IsExamine == 1 ? DistributorAuditStatusEnum.Audited : DistributorAuditStatusEnum.Auditing;
bool flag = userModule.ApplySmallShopsInfo(demodel);
......@@ -2086,7 +2101,7 @@ namespace Mall.WebApi.Controllers.User
{
model = userModule.GetSmallShopsInfoList(new RB_SmallShops_Info_Extend { TenantId = model.TenantId, MallBaseId = model.MallBaseId, Id = query.Id }).OrderByDescending(x => x.CreateDate).FirstOrDefault();
}
if (model==null)
if (model == null)
{
model = new RB_SmallShops_Info_Extend();
}
......
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