这里有没有人使用标准->比较通过模型中的关系将单个输入与 2 个单独的表列进行比较?
这是我的关系声明:
'class' => array(self::HAS_ONE, 'BaseEiEquipItem', 'iar_no'),
'classSi' => array(self::HAS_ONE, 'BaseSiReceivedItem','iar_no'),
现在我想比较我的输入是否存在于这两个表中
if(!empty($_GET['BaseIar']['description'])){
$this->description= $_GET['BaseIar']['description'];
$criteria->with = array('class','classSi');//this will serve as join
$criteria->compare('class.description,classSi.description', $this->description, true ); // true is equivalence of like %%
}
else{
$this->description='';
$criteria->with = array('class','classSi' );//this will serve as join
$criteria->compare('class.description,classSi.description', $this->description, true ); // true is equivalence of like %%
}