如何查询以下内容:
SELECT CONCAT_WS('',apellido,nombre)AS名称FROM user
在哪里CONCAT_WS('',apellido,nombre)喜欢:busqueda
在symfony 4中,将其传递给KNP分页器?
if($form->isSubmitted() && $form->isValid())
{
$data = $request->request->get('form');
$buscar = $data['data'];
$query = $userRepository->createQueryBuilder('p')
->andWhere('p.apellido LIKE :busqueda')
->setParameter('busqueda', '%'.$buscar.'%')
->orderBy('p.apellido', 'ASC')
->getQuery();
$users = $paginator->paginate(
$query,
$request->query->getInt('page', 1),
50
);
return $this->render('user/index.html.twig', [
'users' => $users,
'form' => $form->createView(),
]);
}