Commit e54b1288 authored by 吴春's avatar 吴春
parents 8765bbb5 05c557bd
...@@ -35,6 +35,10 @@ namespace Mall.Model.Extend.Product ...@@ -35,6 +35,10 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public int? ShoppingAddressId { get; set; } public int? ShoppingAddressId { get; set; }
/// <summary> /// <summary>
/// 是否排除取消订单
/// </summary>
public int? IsNotSelectCancel { get; set; }
/// <summary>
/// 商品id /// 商品id
/// </summary> /// </summary>
public int? GoodsId { get; set; } public int? GoodsId { get; set; }
......
...@@ -63,10 +63,52 @@ namespace Mall.Repository.Product ...@@ -63,10 +63,52 @@ namespace Mall.Repository.Product
if (dmodel.IsProxy > 0) { if (dmodel.IsProxy > 0) {
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}"; where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
} }
string orderBy = " g.CreateDate desc";
if (dmodel.OrderBy == 1)
{
//id升序
orderBy = " g.Id asc";
}
else if (dmodel.OrderBy == 2)
{
//id降序
orderBy = " g.Id desc";
}
else if (dmodel.OrderBy == 3)
{
//排序升序
orderBy = " g.Sort asc";
}
else if (dmodel.OrderBy == 4)
{
//排序降序
orderBy = " g.Sort desc";
}
else if (dmodel.OrderBy == 5)
{
//售价升序
orderBy = " g.SellingPrice asc";
}
else if (dmodel.OrderBy == 6)
{
//售价降序
orderBy = " g.SellingPrice desc";
}
else if (dmodel.OrderBy == 7)
{
//库存升序
orderBy = " g.InventoryNum asc";
}
else if (dmodel.OrderBy == 8)
{
//库存降序
orderBy = " g.InventoryNum desc";
}
string sql = $@"select g.* from RB_Goods g string sql = $@"select g.* from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId inner join rb_goods_category c on g.Id=c.GoodsId
where {where} group by g.Id order by g.CreateDate desc"; where {where} group by g.Id order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList(); return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
} }
......
...@@ -63,6 +63,11 @@ namespace Mall.Repository.Product ...@@ -63,6 +63,11 @@ namespace Mall.Repository.Product
{ {
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}={(int)dmodel.OrderStatus}"; where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}={(int)dmodel.OrderStatus}";
} }
if (dmodel.IsNotSelectCancel == 1)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} <> {(int)OrderStatusEnum.Cancel}";
where += $@" and o.{nameof(RB_Goods_Order.Recycled)} =2";
}
if (!string.IsNullOrEmpty(dmodel.OrderStatusIds)) if (!string.IsNullOrEmpty(dmodel.OrderStatusIds))
{ {
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in({dmodel.OrderStatusIds})"; where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in({dmodel.OrderStatusIds})";
......
...@@ -167,6 +167,10 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -167,6 +167,10 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
demodel.TenantId = Convert.ToInt32(parms.uid); demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
if (!(demodel.OrderStatus > 0))
{
demodel.IsNotSelectCancel = 1;
}
var list = orderModule.GetGoodsOrderPageList(1, 10000, out long count, demodel); var list = orderModule.GetGoodsOrderPageList(1, 10000, out long count, demodel);
#region 组装数据 #region 组装数据
int Num = 0; int Num = 0;
...@@ -212,11 +216,11 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -212,11 +216,11 @@ namespace Mall.WebApi.Controllers.MallBase
case 12: case 12:
datarow.ExcelRows.Add(new ExcelColumn(value: (item.DistrictAddress ?? "") + " " + (item.ShoppingAddress ?? "")) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: (item.DistrictAddress ?? "") + " " + (item.ShoppingAddress ?? "")) { }); break;
case 13: case 13:
datarow.ExcelRows.Add(new ExcelColumn(value: (item.PreferPrice ?? 0).ToString()) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: (item2.Original_Price ?? 0).ToString()) { }); break;
case 14: case 14:
datarow.ExcelRows.Add(new ExcelColumn(value: (item.Income ?? 0).ToString()) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: (item2.Final_Price ?? 0).ToString()) { }); break;
case 15: case 15:
datarow.ExcelRows.Add(new ExcelColumn(value: (item.FreightMoney ?? 0).ToString()) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: (item2.FreightMoney ?? 0).ToString()) { }); break;
case 16: case 16:
datarow.ExcelRows.Add(new ExcelColumn(value: item.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: item.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")) { }); break;
case 17: case 17:
......
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