set @a=to_days(now());
select d.UserID,d.OrderID,d.ProductID,sum(PayMoney) as PayMoney,Count(*) as PayCount,RealName,Phone,o.OrderMoney,o.OrderNo,o.OrderDate,b.BankName,b.BankAddress,b.CardNo,max(d.PayTime) as Times ,p.ProductName
from InvestOrderDetail d
left join UserInfo u on d.UserID=u.UserID
left join InvestOrder o on d.OrderID=o.OrderID
left join InvestProduct p on d.ProductID=p.ProductID
left join UserBank b on d.UserID=b.UserID and b.IsDefault=1
where  to_days(d.PayTime)=@a GROUP BY d.UserID,d.OrderID,d.ProductID

 

相关文章:

  • 2021-10-19
  • 2021-08-04
  • 2021-12-23
  • 2022-12-23
  • 2022-01-24
  • 2021-04-25
  • 2021-09-22
  • 2022-12-23
猜你喜欢
  • 2021-04-21
  • 2021-12-10
  • 2021-11-24
  • 2022-03-03
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案