Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save silasrm/743600a18fd78c91dc56fa91fa69d02b to your computer and use it in GitHub Desktop.
Save silasrm/743600a18fd78c91dc56fa91fa69d02b to your computer and use it in GitHub Desktop.
<?php
public function buscaParceiro(Request $request){
$string = $request->get('pesquisa');
$parceiro = DB::table('usuario')
->join('pessoa', 'pessoa.filho_id', '=', 'usuario.id')
->where('usuario.filho_type', '=', "'CompraSerrana\Parceiro'")
->where('pessoa.nome', 'LIKE', "%$string%")
->get();
return view('painel/parceiro/listagem', compact('parceiros'));
}
?>
SQLSTATE[23000]: Integrity constraint violation: 1052
Column 'filho_type' in where clause is ambiguous
(SQL: select * from `usuario` inner join `pessoa` on `pessoa`.`nome` LIKE `%peixe%` where `filho_type` = CompraSerrana\Parceiro)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment