尝试在视图中传递数组,但在第三个

问题描述 投票:0回答:0

我可以在视图中接收服务一和服务二,但第三个服务出现错误

控制器:

    $servicos1 = DB::select("select * from servicos WHERE categoria = 1 ORDER BY servico DESC");

    $servicos2 = DB::select("select * from servicos WHERE categoria = 2 ORDER BY servico DESC");

    $servicos3 = DB::select("select * from servicos WHERE categoria = 3 ORDER BY servico DESC");

    return view('adm.servico', ['servicos1' => $servicos1], ['servicos2' => $servicos2], ['servicos3' => $servicos3]);

查看:

错误异常 未定义的变量:servicos3(查看:C:\Users\Vivere\Documents\Cod

php arrays laravel view controller
© www.soinside.com 2019 - 2024. All rights reserved.