@@ -1601,7 +1601,7 @@ GROUP BY od.GoodsId,o.OrderId
//GROUP BY b.Id order by b.Id desc";
stringsql=$@" SELECT a.OrderSource,a.OrderStatus,sum(b.InsuranceCostMoney) as InsuranceCostMoney,sum(b.InsuranceMoney) as InsuranceMoney,b.CarType,a.OrderClassify,B.Id,b.ServiceCharge,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
stringsql=$@" SELECT a.OrderSource,a.OrderStatus,a.PaymentTime,a.UserId,sum(b.InsuranceCostMoney) as InsuranceCostMoney,sum(b.InsuranceMoney) as InsuranceMoney,b.CarType,a.OrderClassify,B.Id,b.ServiceCharge,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney+IFNULL(b.InsuranceMoney,0)) as AllPrice,SUM(b.DepositMoney+b.DepositFreightMoney) as TotalDepositMoney ,
(IFNULL(b.CostMoney,0)) as CostMoney,0 as PackingMoney, 0 as CostFreight,sum(b.FreightCostMoney) as GoodsFreight,
0 as OtherPrice,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid,oa.RefundActual,b.CouponMoney,b.CompanyProfitRate,b.CompanyId,muser.`Name` as CompanyName,b.YSMoney,b.RealMoney,b.YFMoney,b.PayMoney
...
...
@@ -1723,14 +1723,14 @@ GROUP BY b.Id order by b.Id asc";
{
where+=$" and b.Id in({dmodel.Ids}) ";
}
if(!string.IsNullOrWhiteSpace(dmodel.StartDate))
{
where+=$" and DATE_FORMAT(a.CancelTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
}
if(!string.IsNullOrWhiteSpace(dmodel.EndDate))
{
where+=$" and DATE_FORMAT(a.CancelTime,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
// where += $" and DATE_FORMAT(a.CancelTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
//}
//if (!string.IsNullOrWhiteSpace(dmodel.EndDate))
//{
// where += $" and DATE_FORMAT(a.CancelTime,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
//}
}
stringsql=$@" SELECT a.OrderSource,a.OrderStatus,sum(b.InsuranceCostMoney) as InsuranceCostMoney,sum(b.InsuranceMoney) as InsuranceMoney,b.CarType,a.OrderClassify,B.Id,b.ServiceCharge,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney+IFNULL(b.InsuranceMoney,0)) as AllPrice ,
...
...
@@ -1791,14 +1791,14 @@ GROUP BY b.Id order by b.Id asc";
{
where+=$" and b.Id in({dmodel.Ids}) ";
}
if(!string.IsNullOrWhiteSpace(dmodel.StartDate))
{
where+=$" and DATE_FORMAT(oa.FinishTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
}
if(!string.IsNullOrWhiteSpace(dmodel.EndDate))
{
where+=$" and DATE_FORMAT(oa.FinishTime,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
// where += $" and DATE_FORMAT(oa.FinishTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
//}
//if (!string.IsNullOrWhiteSpace(dmodel.EndDate))
//{
// where += $" and DATE_FORMAT(oa.FinishTime,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
//}
}
stringsql=$@" SELECT a.OrderSource,a.OrderStatus,sum(b.InsuranceCostMoney) as InsuranceCostMoney,sum(b.InsuranceMoney) as InsuranceMoney,b.CarType,a.OrderClassify,B.Id,b.ServiceCharge,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
stringwhere=$@" 1=1 and di.{nameof(RB_Distributor_Info.Status)}=0";
if(dmodel.TenantId>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.TenantId)}={dmodel.TenantId}";
}
if(dmodel.MallBaseId>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.MallBaseId)}={dmodel.MallBaseId}";
}
if(dmodel.UserId>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.UserId)}={dmodel.UserId}";
}
if(dmodel.AuditStatus>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.AuditStatus)}={(int)dmodel.AuditStatus}";
}
if(!string.IsNullOrEmpty(dmodel.UserIds))
{
where+=$@" and di.{nameof(RB_Distributor_Info.UserId)} in({dmodel.UserIds})";
}
if(dmodel.GradeId>=0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.GradeId)}={dmodel.GradeId}";
}
if(!string.IsNullOrEmpty(dmodel.Name))
{
where+=$@" and (mu.{nameof(RB_Member_User.Name)} like '%{dmodel.Name}%' or di.{nameof(RB_Distributor_Info.Name)} like '%{dmodel.Name}%' )";
}
stringsql=$@"select di.*,mu.OpenId,mu.Name as MemberUserName from RB_Distributor_Info di inner join rb_member_user as mu on di.UserId=mu.Id where {where} and mu.CreateDate >='{NowDate}' and mu.CreateDate <='{NowDate} 23:59:59' order by di.CreateDate desc";
stringwhere=$@" 1=1 and di.{nameof(RB_Distributor_Info.Status)}=0";
if(dmodel.TenantId>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.TenantId)}={dmodel.TenantId}";
}
if(dmodel.MallBaseId>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.MallBaseId)}={dmodel.MallBaseId}";
}
if(dmodel.UserId>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.UserId)}={dmodel.UserId}";
}
if(dmodel.AuditStatus>0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.AuditStatus)}={(int)dmodel.AuditStatus}";
}
if(!string.IsNullOrEmpty(dmodel.UserIds))
{
where+=$@" and di.{nameof(RB_Distributor_Info.UserId)} in({dmodel.UserIds})";
}
if(dmodel.GradeId>=0)
{
where+=$@" and di.{nameof(RB_Distributor_Info.GradeId)}={dmodel.GradeId}";
}
if(!string.IsNullOrEmpty(dmodel.Name))
{
where+=$@" and (mu.{nameof(RB_Member_User.Name)} like '%{dmodel.Name}%' or di.{nameof(RB_Distributor_Info.Name)} like '%{dmodel.Name}%' )";
}
stringsql=$@"select di.FXGradeId,COUNT(0) AS SortNum from RB_Distributor_Info di inner join rb_member_user as mu on di.UserId=mu.Id where {where} and mu.CreateDate <='{NowDate} 23:59:59' GROUP BY di.FXGradeId";
stringsql=$" select count(0) as count from RB_Member_User where TenantId={tenantId} and MallBaseId={mallBaseId} and CreateDate <='{startTime} 23:59:59'";
where u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and o.CreateDate <='{startTime} 23:59:59' and o.PaymentTime is not null and u.Id in({userIds})