Commit c9b8a6c5 authored by 黄奎's avatar 黄奎

页面修改

parent 5fb14c46
...@@ -144,81 +144,83 @@ ORDER BY {orderBy} ...@@ -144,81 +144,83 @@ ORDER BY {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
} }
if (demodel.ClassId > 0) else
{
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (demodel.OrderState > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}"; if (demodel.ClassId > 0)
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
} }
else if (demodel.Q_OrderState == 2) if (demodel.OrderState > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
} }
} if (demodel.OrderSource > 0)
if (!string.IsNullOrEmpty(demodel.ClassName))
{
where += $@" and c.{nameof(RB_Class.ClassName)} like '%{demodel.ClassName}%'";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
} }
else if (demodel.OrderForm > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)";
}
else if (demodel.Q_OrderState == 2)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
if (!string.IsNullOrEmpty(demodel.ClassName))
{
where += $@" and c.{nameof(RB_Class.ClassName)} like '%{demodel.ClassName}%'";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')";
}
else
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if (demodel.CourseId > 0)
{
where += $@" and c.{nameof(RB_Class.CouseId)} ={demodel.CourseId}";
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (!string.IsNullOrEmpty(demodel.OPStartTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} >='{demodel.OPStartTime}'";
}
if (!string.IsNullOrEmpty(demodel.OPEndTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} <='{demodel.OPEndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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)}) ";
} }
} }
if (demodel.CourseId > 0)
{
where += $@" and c.{nameof(RB_Class.CouseId)} ={demodel.CourseId}";
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (!string.IsNullOrEmpty(demodel.OPStartTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} >='{demodel.OPStartTime}'";
}
if (!string.IsNullOrEmpty(demodel.OPEndTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} <='{demodel.OPEndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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,64 +264,67 @@ where {where} order by {orderBy} ...@@ -262,64 +264,67 @@ 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}";
} }
if (demodel.ClassId > 0) else
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}"; if (demodel.ClassId > 0)
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (!string.IsNullOrEmpty(demodel.ClassName))
{
where += $@" and c.{nameof(RB_Class.ClassName)} like '%{demodel.ClassName}%'";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
} }
else if (demodel.OrderSource > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (!string.IsNullOrEmpty(demodel.ClassName))
{
where += $@" and c.{nameof(RB_Class.ClassName)} like '%{demodel.ClassName}%'";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')";
}
else
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if (demodel.CourseId > 0)
{
where += $@" and c.{nameof(RB_Class.CouseId)} ={demodel.CourseId}";
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (!string.IsNullOrEmpty(demodel.OPStartTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} >='{demodel.OPStartTime}'";
}
if (!string.IsNullOrEmpty(demodel.OPEndTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} <='{demodel.OPEndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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)}) ";
} }
}
if (demodel.CourseId > 0)
{
where += $@" and c.{nameof(RB_Class.CouseId)} ={demodel.CourseId}";
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (!string.IsNullOrEmpty(demodel.OPStartTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} >='{demodel.OPStartTime}'";
}
if (!string.IsNullOrEmpty(demodel.OPEndTime))
{
where += $@" and c.{nameof(RB_Class.OpenTime)} <='{demodel.OPEndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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,
...@@ -360,71 +365,74 @@ where {where} ...@@ -360,71 +365,74 @@ where {where}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
} }
if (demodel.ClassId > 0) else
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}"; if (demodel.ClassId > 0)
}
if (demodel.SourceId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.SourceId)} ={demodel.SourceId}";
}
if (demodel.OrderState > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
} }
else if (demodel.Q_OrderState == 2) if (demodel.SourceId > 0)
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3"; where += $@" and o.{nameof(RB_Order_ViewModel.SourceId)} ={demodel.SourceId}";
} }
} if (demodel.OrderState > 0)
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
} }
else if (demodel.OrderSource > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)";
}
else if (demodel.Q_OrderState == 2)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')";
}
else
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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)}) ";
}
if (demodel.OrderType > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)demodel.OrderType} ";
} }
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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)}) ";
}
if (demodel.OrderType > 0)
{
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,48 +472,51 @@ WHERE {where} ORDER BY {orderBy} ...@@ -464,48 +472,51 @@ 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}";
} }
if (demodel.ClassId > 0) else
{
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{ {
if (demodel.Group_Id > 0) if (demodel.ClassId > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
} }
else if (demodel.OrderSource > 0)
{ {
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')"; where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')";
}
else
{
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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)}) ";
} }
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if (!string.IsNullOrEmpty(demodel.EndTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
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,
......
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