Commit 1ab24d35 authored by 吴春's avatar 吴春

提交代码

parent 983ae040
......@@ -140,5 +140,10 @@ namespace Mall.Model.Extend.Product
public int IsPublic { get; set; }
#endregion
/// <summary>
/// 供应商名称
/// </summary>
public string SupplierName { get; set; }
}
}
......@@ -27,42 +27,42 @@ namespace Mall.Repository.Product
string where = $" 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderDetailIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
where += $@" and a.{nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
}
if (dmodel.OrderId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
}
if (dmodel.OrderType > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if (dmodel.IsComment > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and {nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
where += $@" and a.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and {nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
where += $@" and a.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
}
string sql = $@"SELECT * FROM rb_goods_orderdetail where {where} order by Id asc";
string sql = $@"SELECT a.*,b.`Name` as SupplierName FROM rb_goods_orderdetail as a LEFT JOIN rb_supplier as b on a.SupplierId=b.ID where {where} order by a.Id asc";
return Get<RB_Goods_OrderDetail_Extend>(sql).ToList();
}
......
......@@ -79,6 +79,7 @@ namespace Mall.WebApi.Controllers.MallBase
PaymentWayName = x.PaymentWay.GetEnumName(),
DetailList = x.DetailList.Select(y => new
{
y.SupplierName,
y.FreightCostMoney,
y.FreightMoney,
y.CostMoney,
......
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