Commit 2a080cf4 authored by liudong1993's avatar liudong1993

粉象返佣抵扣 + 订单规格图片问题

parent f098eb63
...@@ -326,5 +326,9 @@ namespace Mall.Model.Entity.Product ...@@ -326,5 +326,9 @@ namespace Mall.Model.Entity.Product
/// </summary> /// </summary>
public int StoresId { get; set; } public int StoresId { get; set; }
/// <summary>
/// 购买抵扣佣金金额
/// </summary>
public decimal? DeductionCommission { get; set; }
} }
} }
...@@ -124,6 +124,10 @@ namespace Mall.Model.Entity.Product ...@@ -124,6 +124,10 @@ namespace Mall.Model.Entity.Product
/// </summary> /// </summary>
public int? IsRemit { get; set; } public int? IsRemit { get; set; }
/// <summary>
/// 购买抵扣佣金
/// </summary>
public decimal? DeductionCommission { get; set; }
} }
......
...@@ -354,5 +354,10 @@ namespace Mall.Model.Entity.Product ...@@ -354,5 +354,10 @@ namespace Mall.Model.Entity.Product
/// 服务人员的id /// 服务人员的id
/// </summary> /// </summary>
public int? ServicepersonalId { get; set; } public int? ServicepersonalId { get; set; }
/// <summary>
/// 购买抵扣佣金金额
/// </summary>
public decimal? DeductionCommission { get; set; }
} }
} }
...@@ -167,5 +167,10 @@ namespace Mall.Model.Entity.User ...@@ -167,5 +167,10 @@ namespace Mall.Model.Entity.User
/// 粉象等级图标 /// 粉象等级图标
/// </summary> /// </summary>
public string Icon { get; set; } public string Icon { get; set; }
/// <summary>
/// 返佣类型 1正常返佣 2购买抵扣
/// </summary>
public int? CommissionType { get; set; }
} }
} }
This diff is collapsed.
...@@ -5358,6 +5358,7 @@ namespace Mall.Module.User ...@@ -5358,6 +5358,7 @@ namespace Mall.Module.User
{ nameof(RB_Distributor_FXGrade.DecimalType),demodel.DecimalType}, { nameof(RB_Distributor_FXGrade.DecimalType),demodel.DecimalType},
{ nameof(RB_Distributor_FXGrade.Description),demodel.Description}, { nameof(RB_Distributor_FXGrade.Description),demodel.Description},
{ nameof(RB_Distributor_FXGrade.Icon),demodel.Icon}, { nameof(RB_Distributor_FXGrade.Icon),demodel.Icon},
{ nameof(RB_Distributor_FXGrade.CommissionType),demodel.CommissionType}
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
......
...@@ -83,7 +83,7 @@ where {where} order by oc.Id asc"; ...@@ -83,7 +83,7 @@ where {where} order by oc.Id asc";
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
} }
string sql = $@"SELECT oc.OrderId,oc.UserId,oc.Grade,oc.Type,oc.CommissionState,SUM(oc.Commission) as Commission FROM RB_Goods_OrderCommission oc string sql = $@"SELECT oc.OrderId,oc.UserId,oc.Grade,oc.Type,oc.CommissionState,SUM(oc.Commission) as Commission,SUM(oc.DeductionCommission) as DeductionCommission FROM RB_Goods_OrderCommission oc
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) 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 {where} group by oc.OrderId,oc.UserId,oc.Grade,oc.Type order by oc.Grade asc"; where {where} group by oc.OrderId,oc.UserId,oc.Grade,oc.Type order by oc.Grade asc";
return Get<RB_Goods_OrderCommission_Extend>(sql).ToList(); return Get<RB_Goods_OrderCommission_Extend>(sql).ToList();
......
...@@ -43,5 +43,30 @@ namespace Mall.Repository.Product ...@@ -43,5 +43,30 @@ namespace Mall.Repository.Product
string sql = $@"select * from RB_Goods_SpecificationValue where {where} order by Id asc"; string sql = $@"select * from RB_Goods_SpecificationValue where {where} order by Id asc";
return Get<RB_Goods_SpecificationValue_Extend>(sql).ToList(); return Get<RB_Goods_SpecificationValue_Extend>(sql).ToList();
} }
/// <summary>
/// 获取规格值图片
/// </summary>
/// <param name="goodsId"></param>
/// <param name="specificationSort"></param>
/// <returns></returns>
public string GetSpecificationImage(int goodsId, string specificationSort)
{
try
{
int Sort = Convert.ToInt32(specificationSort.Split(":")[0]);
string sql = $@"select * from RB_Goods_SpecificationValue where Status=0 and GoodsId={goodsId} and Sort={Sort} and Image<> '' order by Id asc limit 1";
var model = Get<RB_Goods_SpecificationValue_Extend>(sql).FirstOrDefault();
if (model != null)
{
return model.Image ?? "";
}
return "";
}
catch (Exception)
{
return "";
}
}
} }
} }
...@@ -95,6 +95,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -95,6 +95,7 @@ namespace Mall.WebApi.Controllers.MallBase
x.Income, x.Income,
x.FreightMoney, x.FreightMoney,
x.PaymentWay, x.PaymentWay,
DeductionCommission = x.DeductionCommission ?? 0,
PaymentWayName = x.PaymentWay.GetEnumName(), PaymentWayName = x.PaymentWay.GetEnumName(),
CouponMoney = x.CouponMoney ?? 0, CouponMoney = x.CouponMoney ?? 0,
IntegralMoney = (x.DetailList != null && x.DetailList.Any()) ? (x.DetailList.Sum(x => x.IntegralMoney ?? 0)) : 0, IntegralMoney = (x.DetailList != null && x.DetailList.Any()) ? (x.DetailList.Sum(x => x.IntegralMoney ?? 0)) : 0,
...@@ -137,6 +138,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -137,6 +138,7 @@ namespace Mall.WebApi.Controllers.MallBase
InsuranceCostMoney = y.InsuranceCostMoney ?? 0, InsuranceCostMoney = y.InsuranceCostMoney ?? 0,
IntegralMoney = y.IntegralMoney ?? 0, IntegralMoney = y.IntegralMoney ?? 0,
IntegralNumber = y.IntegralNumber ?? 0, IntegralNumber = y.IntegralNumber ?? 0,
DeductionCommission = y.DeductionCommission ?? 0,
SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new
{ {
z.FrID, z.FrID,
...@@ -2338,7 +2340,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -2338,7 +2340,8 @@ namespace Mall.WebApi.Controllers.MallBase
z.Mobile, z.Mobile,
z.Name, z.Name,
z.Commission, z.Commission,
z.CommissionState z.CommissionState,
DeductionCommission = z.DeductionCommission ?? 0
}), }),
x.TenantId, x.TenantId,
x.MallBaseId, x.MallBaseId,
......
...@@ -2741,6 +2741,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -2741,6 +2741,7 @@ namespace Mall.WebApi.Controllers.User
x.UpgradeId, x.UpgradeId,
x.Description, x.Description,
x.Icon, x.Icon,
x.CommissionType,
UpdateDate = x.UpdateDate.HasValue ? x.UpdateDate.Value.ToString("yyyy-MM-dd") : "" UpdateDate = x.UpdateDate.HasValue ? x.UpdateDate.Value.ToString("yyyy-MM-dd") : ""
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
......
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