Commit 6916332e authored by 黄奎's avatar 黄奎

新增参数

parent 5d67641a
...@@ -1097,7 +1097,7 @@ as t GROUP BY t.CreateDate desc"; ...@@ -1097,7 +1097,7 @@ as t GROUP BY t.CreateDate desc";
{ {
if (!string.IsNullOrWhiteSpace(dmodel.OrderNo)) if (!string.IsNullOrWhiteSpace(dmodel.OrderNo))
{ {
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'"; where += $" and a.OrderNo like '%{dmodel.OrderNo}%' ";
} }
...@@ -1157,7 +1157,7 @@ GROUP BY b.GoodsId,b.SupplierId,b.OrderId "; ...@@ -1157,7 +1157,7 @@ GROUP BY b.GoodsId,b.SupplierId,b.OrderId ";
{ {
if (!string.IsNullOrWhiteSpace(dmodel.OrderNo)) if (!string.IsNullOrWhiteSpace(dmodel.OrderNo))
{ {
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'"; where += $" and a.OrderNo like '%{dmodel.OrderNo}%' ";
} }
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
...@@ -1337,12 +1337,13 @@ GROUP BY b.Id order by b.Id asc"; ...@@ -1337,12 +1337,13 @@ GROUP BY b.Id order by b.Id asc";
public List<OrderStatistics_Query> GetFXAllOrderProfitLossList(OrderStatistics_Query dmodel) public List<OrderStatistics_Query> GetFXAllOrderProfitLossList(OrderStatistics_Query dmodel)
{ {
string where = "where 1=1 and a.OrderStatus in(2,3,4,5,6) "; string where = "where 1=1 and a.OrderStatus in(2,3,4,5,6) ";
DynamicParameters parameters = new DynamicParameters();
if (dmodel != null) if (dmodel != null)
{ {
if (!string.IsNullOrWhiteSpace(dmodel.OrderNo)) if (!string.IsNullOrWhiteSpace(dmodel.OrderNo))
{ {
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'"; where += $" and a.OrderNo like @OrderNo ";
parameters.Add("OrderNo", "%" + dmodel.OrderNo.Trim() + "%");
} }
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
...@@ -1405,7 +1406,7 @@ LEFT JOIN rb_member_user as muser on muser.id=b.CompanyId ...@@ -1405,7 +1406,7 @@ LEFT JOIN rb_member_user as muser on muser.id=b.CompanyId
left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where} left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where}
GROUP BY b.Id order by b.Id asc "; GROUP BY b.Id order by b.Id asc ";
return Get<OrderStatistics_Query>(sql).ToList(); return Get<OrderStatistics_Query>(sql, parameters).ToList();
} }
......
...@@ -293,12 +293,16 @@ GROUP BY A.GoodsId,A.GoodsName) as a ORDER BY a.{query.OrderBy} LIMIT 100 "); ...@@ -293,12 +293,16 @@ GROUP BY A.GoodsId,A.GoodsName) as a ORDER BY a.{query.OrderBy} LIMIT 100 ");
{ {
query.OrderBy = "Income desc"; query.OrderBy = "Income desc";
} }
builder.AppendFormat($@"SELECT * from (SELECT C.`Name` AS UserName,C.Photo,COUNT(1) SaleCount,SUM(A.Final_Price) AS Income builder.AppendFormat($@"
FROM rb_goods_orderdetail AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId 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 LEFT JOIN rb_member_user AS C ON B.UserId=C.Id
WHERE 1=1 AND A.GoodsId>0 {where} WHERE 1=1 AND A.GoodsId>0 {where}
GROUP BY B.UserId,C.`Name` GROUP BY B.UserId,C.`Name`
) as t ORDER BY t.{query.OrderBy} LIMIT 100"); ) as t ORDER BY t.{query.OrderBy} LIMIT 100");
var list = Get<MallSalesUserTop>(builder.ToString()).ToList(); var list = Get<MallSalesUserTop>(builder.ToString()).ToList();
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
......
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