我有以下代码搜索我有的表
$searchTax = new TaxonomySearch();
$dataProviderTax = $searchTax->search(['TaxonomySearch'=>['tax_general'=>$spec]]);
如何访问此搜索的结果,以便我可以使用结果搜索另一个表?
$searchModel = new NpiSearch();
$dataProvider = $searchModel->search(['NpiSearch'=>['Provider_Business_Practice_Location_Address_Postal_Code'=>***results from dataProvidexTax***]]);
并立即显示所有内容
答案 0 :(得分:0)
阅读本文: findAll() in yii
您可能想要使用的其他方法:
$firstResults = results from findAll();
$fieldsToSearch = CHtml::listData($firstResults, 'fieldkeyselected', 'fieldvalueselected')
$additionalCondition = !empty($fieldsToSearch )?'field in ('.implode(',',$fieldsToSearch ).')':'';
... use findAll( $additionalCondition )