laravel:搜索形式'<='

时间:2019-03-29 23:41:39

标签: laravel

当我使用'like'时,它起作用,但是当我使用'<='时,它不起作用

    public function search(Request $request)
    {
        //
        $adultes=$request->get('adultes');


         $dispos=   Disponible::where('adultes', '<=','%'.$adultes. '%' )
         ->paginate(5);

        return view('rooms_dispo',['dispos'=>$dispos]);

    }

1 个答案:

答案 0 :(得分:1)

public function search(Request $request)
{
    $adultes = $request->get('adultes');
    $dispos = Disponible::where('adultes', '<=', $adultes)->paginate(5);
    return view('rooms_dispo', ['dispos' => $dispos]);

 }