where+=$@" and {nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
}
if(dmodel.MallBaseId>0)
{
where+=$@" and {nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
}
if(dmodel.OrderId>0)
{
where+=$@" and {nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}";
}
if(dmodel.UserId>0)
{
where+=$@" and {nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}";
}
if(!string.IsNullOrEmpty(dmodel.OrderIds))
{
where+=$@" and {nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
}
stringsql=$@"SELECT OrderId,UserId,Grade,SUM(Commission) as Commission FROM RB_Goods_OrderCommission where {where} group by OrderId,UserId,Grade order by Grade asc";