stringwhere=$" where 1=1 and a.OrderStatus in(2,3,4,6,5)";
stringwhere=$" where 1=1 and (a.OrderStatus in(2,3,4,6,5) or( a.{nameof(RB_Goods_Order.OrderStatus)}=7 and a.{nameof(RB_Goods_Order.PaymentTime)} is not NULL))";
stringpayMemerNumWhere="";
stringorderTypeWhere="";
stringsql="";
...
...
@@ -832,7 +832,8 @@ from (SELECT DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )as CreateDate,b.GoodsTotalNum,
LEFT JOIN (SELECT OrderId,SUM(Number)as GoodsTotalNum from rb_goods_orderdetail where 1=1 {orderTypeWhere} GROUP BY OrderId)as b on a.OrderId=b.OrderId
LEFT JOIN (SELECT COUNT(DISTINCT UserId) as PayMemerNum, DATE_FORMAT(CreateDate,'%Y-%m-%d' ) as CreateDate from rb_goods_order where 1=1 {payMemerNumWhere} GROUP BY DATE_FORMAT(CreateDate,'%Y-%m-%d' ))
as c on c.CreateDate=DATE_FORMAT(a.CreateDate,'%Y-%m-%d' ) {where} )
as t GROUP BY t.CreateDate desc ";
as t GROUP BY t.CreateDate desc";
returnGet<RB_Goods_Order_Extend>(sql).ToList();
}
...
...
@@ -945,8 +946,8 @@ LEFT JOIN rb_member_user as c on b.UserId=c.Id
}
elseif(dmodel.OrderStatus==3)
{
where+=$@" and a.{nameof(RB_Goods_Order.OrderStatus)}=7";
payMemerNumWhere+=$@" and {nameof(RB_Goods_Order.OrderStatus)}=7";
where+=$@" and a.{nameof(RB_Goods_Order.OrderStatus)}=7 and a.{nameof(RB_Goods_Order.PaymentTime)} is not NULL";
payMemerNumWhere+=$@" and {nameof(RB_Goods_Order.OrderStatus)}=7 and a.{nameof(RB_Goods_Order.PaymentTime)} is not NULL";