我试图找到$ elementMatch条件,但不幸的是,没有任何方法可以正常运行:
http://forum.phalconphp.com/discussion/6033/
$result = Hotel::findFirst(array(
'$elementMatch' => array(
array('sellingCodes' => $this->request->getPost('sellingCode')),
array("supplierCode" => $this->request->getPost('supplierCode'))
)
));
答案 0 :(得分:0)
根据manual,您的问题的解决方案可能与此有些接近:
$result = Hotel::findFirst(array(
'conditions' => array(
'sellingCodes' => $this->request->getPost('sellingCode'),
'supplierCode' => $this->request->getPost('supplierCode')
)
));