$model_reg_b = BusinessNatureMappingForm::model()->findbyPk($model_reg);
foreach ($model_reg_b->BusinessNatureMappingForm as $keyi1 => $model_reg_bb) {
$model_ownerm = OwnershipSpecificDetailsForm::model()->findByAttributes(array("bnsd_bnmid" => $model_reg_bb->bnm_regid));
}
答案 0 :(得分:0)
我认为您使用模型作为findbyPk()
的参数而不是主键属性(例如$model_reg->id
)。
改变这个:
$model_reg_b = BusinessNatureMappingForm::model()->findbyPk($model_reg);
对此:
$model_reg_b = BusinessNatureMappingForm::model()->findbyPk($model_reg->primary_key_column);