left join rb_customer_hotelorderdetail d on o.OrderId = d.OrderId
left join rb_customer_hotelorderroom r on d.Id = r.DetailId
{((userInfo?.SimpleEasy??0)==1?" left JOIN rb_appoint_op aop on aop.OrderId=o.OrderId and aop.ResourceType="+(int)Common.Enum.ResourceTypeEnum.Hotel:"")}
{(!string.IsNullOrEmpty(demodel.ContactName)?" left join rb_travel_guest g on o.OrderId=g.OrderId and g.IsAllograph=3 and g.Status=0":"")}
where {where} group by o.OrderId order by o.OrderId desc";
@@ -317,6 +317,10 @@ left join {nameof(RB_Visa_Management)} m on A.{nameof(RB_Sell_VisaProduct.VisaMa
{
where+=$@" AND B.{nameof(RB_Sell_VisaProduct.Name)} like '%{model.Name}%'";
}
if(!string.IsNullOrWhiteSpace(model.ContactName))
{
where+=$@" AND g.Name like '%{model.ContactName}%'";
}
if(model.OpEmpId>0)
{
where+=$@" AND case when A.{nameof(RB_Sell_VisaOrder.FinishEmpId)} >0 then A.{nameof(RB_Sell_VisaOrder.FinishEmpId)} ={model.OpEmpId} else B.{nameof(RB_Sell_VisaProduct.CreateBy)} ={model.OpEmpId} end";
...
...
@@ -395,6 +399,7 @@ left join {nameof(RB_Visa_Management)} m on A.{nameof(RB_Sell_VisaProduct.VisaMa
stringsql=$@" select A.*,B.Name,B.SendVisaDate as SendStartDate,B.CoverImage,B.RB_Branch_Id as OutBranchId,B.VisaManagementId,case when A.FinishEmpId >0 then A.FinishEmpId else B.CreateBy end as OpEmpId from {TableName} as A
left join {TableNameProduct} as B on A.VisaId=B.Id
{((userInfo?.SimpleEasy??0)==1?(" left JOIN rb_appoint_op aop on aop.OrderId=a.Id and aop.ResourceType="+(int)Common.Enum.ResourceTypeEnum.Visa):"")}
{(!string.IsNullOrEmpty(model.ContactName)?" left join rb_travel_guest g on a.Id=g.OrderId and g.IsAllograph=1 and g.Status=0":"")}
{where} GROUP BY a.Id order by A.{nameof(RB_Sell_VisaOrder.CreateTime)} desc";
left JOIN {(Config.IsOnline?"uat_reborn_dmc":"reborn_dmc")}.rb_appoint_op aop on aop.OrderId=t.OrderId and aop.ResourceType=8
left join (select d.OrderId,sum(d.Commission) as Commission from rb_ticket_commission_details d where d.Status =0 group by d.OrderId) cd on t.OrderId = cd.OrderId
{(!string.IsNullOrEmpty(demodel.GuestName)?$" left join {(Config.IsOnline?"uat_reborn_dmc":"reborn_dmc")}.rb_travel_guest g on t.OrderId=g.OrderId and g.IsAllograph=5 and g.Status=0":"")}
WHERE {where}
group by t.OrderId
ORDER BY t.CreateTime DESC";
...
...
@@ -361,11 +362,11 @@ ORDER BY t.CreateTime DESC";
{
where+=$@" and t.{nameof(RB_CRMTicket_Order_Extend.GuestId)} ={demodel.GuestId}";
}
//if (!string.IsNullOrEmpty(demodel.GuestName))
//{
// where += $@" and concat(g.SurName,g.Name) like @GuestName";
left JOIN {(Config.IsOnline?"uat_reborn_dmc":"reborn_dmc")}.rb_appoint_op aop on aop.OrderId=t.OrderId and aop.ResourceType=8
{(!string.IsNullOrEmpty(demodel.GuestName)?$" left join {(Config.IsOnline?"uat_reborn_dmc":"reborn_dmc")}.rb_travel_guest g on t.OrderId=g.OrderId and g.IsAllograph=5 and g.Status=0":"")}