0
數據
有人可以解釋我如何兩個爾康表中搜索數據:如何搜索有兩種爾康表
我有這個疑問:
$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);
會有一些方法來做到這一點這樣:
$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;
我其實不知道該怎麼做。
我所做的並不是爲我工作。