我当前的代码显示最近 7 天的投注单,但无论日期如何,我都需要显示最近 7 个投注单。
select
betsliphistory.MatchID,Team1.Name as HomeTeam ,
Team2.Name as AwayTeam, BetSlipID , userid , TipID ,
matches.ResultTipID ,betsliphistory.`Date`
from betsliphistory
inner join matches on betsliphistory.MatchID = matches.MatchID
inner join teams as Team1 on matches.HomeTeamID = Team1.TeamID
inner join teams as Team2 on matches.AwayTeamID = Team2.TeamID
where userid =".$user."
and betsliphistory.`Date` between CURDATE()-7 and CURDATE()
order by BetSlipID , MatchID;