$data = DB::table('kititens')->select('kititens.qtde','kititens.base',DB::row("(SELECT descricao FROM produtos WHERE kititens.kit = produtos.id) AS kit"),DB::row("(SELECT descricao FROM produtos WHERE kititens.produto = produtos.id) AS item"))->get();
Thank you, I'll take the test. I managed to sort this out, but I'll compare to see the difference.. I created the query so.
$query = DB::table('kititens')->where('deleted_at', '=', NULL) ->select('kititens.*', (DB::raw("(SELECT descricao FROM produtos u1 WHERE u1.id = kititens.produto ) AS kit ")), (DB::raw("(SELECT descricao FROM produtos u1 WHERE u1.id = kititens.kit ) AS item"))) ->get();
Will I have any future problems?
Thank you for the help.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community