Someone could explain me How to search data in two phalcon tables:
I have this query:
$Q = $this->request->getPost("data"); $phql = 'SELECT b.idbank,b.name,m.description,m.date
FROM bank b
inner join movement m on b.idbank=m.idbank
WHERE b.estado = 1 and b.name like "%'.$Q.'%" or m.description like "%'.$Q.'%"
Order by b.idbank desc ';$bank = $this->modelsManager->executeQuery($phql);
There would be some way to do it this way:
$Q = $this->request->getPost("data");
$bank = Bank::find( [ "name like '%:dato:%'", "bind" => [ "dato" => $Q ] ] ); $mov = $bank->getmovement( [ "description like '%:dato:%'", "bind" => [ "dato" => $Q ] ] ); $bank = $mov->bank;
I actually do not know how to do it.
What I did is not working for me.
Some help would be important to me. thank.