Hi,
How to Show Records Relation Through Search,
I have table relation below,
class Deposit extends CActiveRecord
{
public $auction_id;
public function relations()
{
return array(
'charge' =>array(self::HAS_ONE, 'Charge', 'deposit_id'),
'bid'=>array(self::HAS_MANY,'Bid',array('bid_id'=>'id'),'through'=>'charge'),
);
}
}
I Have Relation Charge table to bid table I write that Relation Through,
I write Search function,
public function search()
{
$criteria->compare(‘bid.auction_id’,$this->auction_id,true,‘OR’);
}
And then i write view page to view the record bid table auction and also view the deposit table record So i wrote,
$this->widget(‘bootstrap.widgets.TbGridView’, array(
'id'=>'deposit-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'ajaxUpdate'=>false,
'columns'=>array(
‘id’,
'user_id',
array(
'header'=>'Auction Id',
'name'=>'auction_id',
'value'=>'$data->bid->auction_id'),
Id,User_id in Deposit table record but no records show in Bid table …Please Tell me Solution ?