Commit 7a9ad4e5 authored by 吴春's avatar 吴春

提交订单

parent 02a723b7
......@@ -837,12 +837,12 @@ LEFT JOIN rb_member_user as c on b.UserId=c.Id
{
where += $" AND DATE_FORMAT(a.{nameof(RB_Goods_Order.CreateDate)},'%Y-%m-%d' )>= DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' )";
// payMemerNumWhere += $" AND DATE_FORMAT({nameof(RB_Goods_Order.CreateDate)},'%Y-%m-%d' )>= DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' )";
payMemerNumWhere += $" AND DATE_FORMAT(a.{nameof(RB_Goods_OrderAfterSale.CreateDate)},'%Y-%m-%d' )>= DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' )";
payMemerNumWhere += $" AND DATE_FORMAT({nameof(RB_Goods_OrderAfterSale.CreateDate)},'%Y-%m-%d' )>= DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' )";
}
if (!string.IsNullOrWhiteSpace(dmodel.EndDate))
{
where += $" AND DATE_FORMAT(a.{nameof(RB_Goods_Order.CreateDate)},'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' )";
payMemerNumWhere += $" AND DATE_FORMAT(a.{nameof(RB_Goods_OrderAfterSale.CreateDate)},'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' )";
payMemerNumWhere += $" AND DATE_FORMAT({nameof(RB_Goods_OrderAfterSale.CreateDate)},'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' )";
// payMemerNumWhere += $" AND DATE_FORMAT({nameof(RB_Goods_Order.CreateDate)},'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' )";
}
......@@ -1322,5 +1322,105 @@ GROUP BY od.GoodsId,o.OrderId
return Get<RB_Goods_Order_Extend>(sql).ToList();
}
#endregion
#region 店铺订单
/// <summary>
/// 分销订单
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetSmallShopOrdersPageList(int pageIndex, int pageSize, out long count, RB_Goods_Order_Extend dmodel)
{
string where = $" 1=1 and o.{nameof(RB_Goods_Order.Status)}=0";
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in(1,2,3,4,5,6)";
if (dmodel.TenantId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderId)}={dmodel.OrderId}";
}
if (dmodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderSource)}={(int)dmodel.OrderSource}";
}
if (dmodel.OrderType > 0)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.OrderType)}={dmodel.OrderType}";
}
if (dmodel.DeliveryMethod > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.DeliveryMethod)}={(int)dmodel.DeliveryMethod}";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and o.{nameof(RB_Goods_Order.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and o.{nameof(RB_Goods_Order.CreateDate)} <='{dmodel.EndTime} 23:59:59'";
}
if (dmodel.OrderStatus > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}={(int)dmodel.OrderStatus}";
}
if (!string.IsNullOrEmpty(dmodel.OrderNo))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderNo)} like '%{dmodel.OrderNo}%'";
}
if (!string.IsNullOrEmpty(dmodel.MerchantsNo))
{
where += $@" and o.{nameof(RB_Goods_Order.MerchantsNo)} like '%{dmodel.MerchantsNo}%'";
}
if (!string.IsNullOrEmpty(dmodel.UserName))
{
where += $@" and u.{nameof(RB_Member_User.Name)} like '%{dmodel.UserName}%'";
}
if (dmodel.UserId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.UserId)}={(int)dmodel.UserId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.Consignee))
{
where += $@" and o.{nameof(RB_Goods_Order.Consignee)} like '%{dmodel.Consignee}%'";
}
if (!string.IsNullOrEmpty(dmodel.Mobile))
{
where += $@" and o.{nameof(RB_Goods_Order.Mobile)} like '%{dmodel.Mobile}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if (dmodel.Recycled > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.Recycled)}={(int)dmodel.Recycled}";
}
if (dmodel.DistributionUserId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.UserId)}={dmodel.DistributionUserId}";
}
string sql = $@"SELECT o.*,u.Name as UserName FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
INNER JOIN rb_member_user u on o.UserId=u.Id
LEFT JOIN rb_smallshops_commission oc on o.OrderId = oc.OrderId
where {where} group by o.OrderId order by o.CreateDate desc";
return GetPage<RB_Goods_Order_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
#endregion
}
}
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