【发布时间】:2019-03-27 13:44:54
【问题描述】:
我有两个回合“第一和淘汰赛”。只有4队在第一轮得分最高的情况下才能进入淘汰赛。现在首先,我想从第一轮中选择那 4 支球队,然后检查输入的球队是否在选定的 4 支球队中。看看我的代码(到目前为止我试过) [在这张图片中,标记的两支球队应该被排除在外,但是当我给出条件时,它并不排除这两个球队]
$matches= new Match();
$matches->team1 = $request->input('team1');
$matches->team2 = $request->input('team2');
$ko = DB::select('SELECT * FROM points WHERE round="first" ORDER BY points DESC , run_rate DESC LIMIT 4');
if($ko == $matches->team1 || $ko == $matches->team2) {
$matches->round = "ko";
} else {
$matches->round = "first";
}
【问题讨论】: