我有两轮“第一轮和淘汰赛”。只有四支球队在第一轮获得最高分时才能进入淘汰赛。现在,我首先要从第一轮中选择那4个球队,然后检查输入的球队是否在所选的4个球队中。看一下我的代码(到目前为止,我已经尝试过)。我的问题是,如果我从dd($ kos)下面输入两个团队名称,它将保存$ matches-> round =“ first” Here i attach a dd($kos),if my inputted data is in the dd($kos) only then the $matches round="ko" else the $matches round="first" >
$matches->round = "first";
$kos = DB::table("points")
->where("round", "=", "first")
->groupBy('team')
->orderByRaw('SUM(points) DESC')
->orderBy("run_rate", "DESC")
->limit(4)
->get();
if(count($kos) > 0)
{
foreach($kos AS $ko){
if($ko->team == $matches->team1 && $ko->team == $matches->team2) {
$matches->round = "ko";
break;
}
}
}