Commit 629cfa00 authored by 黄奎's avatar 黄奎

首页统计修改

parent 6916332e
......@@ -293,17 +293,21 @@ GROUP BY A.GoodsId,A.GoodsName) as a ORDER BY a.{query.OrderBy} LIMIT 100 ");
{
query.OrderBy = "Income desc";
}
List<MallSalesUserTop> list = new List<MallSalesUserTop>();
builder.AppendFormat($@"
SELECT *
FROM
(
SELECT C.`Name` AS UserName,C.Photo,COUNT(1) SaleCount,SUM(A.Final_Price) AS Income
FROM rb_goods_orderdetail AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_member_user AS C ON B.UserId=C.Id
WHERE 1=1 AND A.GoodsId>0 {where}
GROUP BY B.UserId,C.`Name`
SELECT B.UserId, C.`Name` AS UserName,C.Photo,COUNT(1) SaleCount,SUM(A.Final_Price) AS Income
FROM rb_goods_orderdetail AS A INNER JOIN RB_Goods_OrderCommission AS oc ON A.Id=oc.OrderDetailId AND A.OrderId=oc.OrderId
INNER JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_member_user AS C ON oc.UserId=C.Id
WHERE 1=1 AND A.GoodsId>0 {where}
GROUP BY oc.UserId,C.`Name`
) as t ORDER BY t.{query.OrderBy} LIMIT 100");
var list = Get<MallSalesUserTop>(builder.ToString()).ToList();
list = Get<MallSalesUserTop>(builder.ToString()).ToList();
if (list != null && list.Count > 0)
{
int index = 1;
......
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