Commit c9b8a6c5 authored by 黄奎's avatar 黄奎

页面修改

parent 5fb14c46
...@@ -144,6 +144,8 @@ ORDER BY {orderBy} ...@@ -144,6 +144,8 @@ ORDER BY {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
} }
else
{
if (demodel.ClassId > 0) if (demodel.ClassId > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
...@@ -218,7 +220,7 @@ ORDER BY {orderBy} ...@@ -218,7 +220,7 @@ ORDER BY {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) "; where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) ";
} }
}
string orderBy = " o.OrderId asc"; string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1) if (demodel.Q_OrderBy == 1)
{ {
...@@ -262,6 +264,8 @@ where {where} order by {orderBy} ...@@ -262,6 +264,8 @@ where {where} order by {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
} }
else
{
if (demodel.ClassId > 0) if (demodel.ClassId > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
...@@ -321,6 +325,7 @@ where {where} order by {orderBy} ...@@ -321,6 +325,7 @@ where {where} order by {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) "; where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) ";
} }
}
string sql = $@" select SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice, string sql = $@" select SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income, SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
...@@ -360,6 +365,8 @@ where {where} ...@@ -360,6 +365,8 @@ where {where}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
} }
else
{
if (demodel.ClassId > 0) if (demodel.ClassId > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
...@@ -426,6 +433,7 @@ where {where} ...@@ -426,6 +433,7 @@ where {where}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)demodel.OrderType} "; where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)demodel.OrderType} ";
} }
}
string orderBy = " o.OrderId asc"; string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1) if (demodel.Q_OrderBy == 1)
{ {
...@@ -464,6 +472,8 @@ WHERE {where} ORDER BY {orderBy} ...@@ -464,6 +472,8 @@ WHERE {where} ORDER BY {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
} }
else
{
if (demodel.ClassId > 0) if (demodel.ClassId > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
...@@ -507,6 +517,7 @@ WHERE {where} ORDER BY {orderBy} ...@@ -507,6 +517,7 @@ WHERE {where} ORDER BY {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) "; where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) ";
} }
}
string sql = $@" string sql = $@"
SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice, SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income, SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
......
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