adri00713
(Ralphdanenielsantos)
February 11, 2013, 8:08pm
1
i have two models BaseReceivedItem and BaseRefSiDetails
BaseReceivedItem model relation
public function relations(){
return array(
'details' => array(self::BELONGS_TO, 'BaseRefSiDetails', 'details_id'),
);
}
BaseRefSiDetails model relation
public function relations(){
return array(
'siReceivedItems' => array(self::HAS_MANY, 'BaseSiReceivedItem', 'details_id'),
);
}
i need to display datas from baseresidetails into the grid of basereceiveditem
i use this
$data->details->stockno;
but no results found please help .
seenivasan
(Chellamnivas)
February 11, 2013, 8:24pm
2
Dear Friend
It should be like this.
'columns'=>array(
'id',
'details.stockno',
......................................
.........................................
)
or
it should be
'columns'=>array(
'id',
array(
'name'=>'someName',
'value'=>'$data->details->stockno',
),
......................................
.........................................
)
Regards.
adri00713
(Ralphdanenielsantos)
February 11, 2013, 8:40pm
3
i tried it before but same no results maybe theres problem on my relations …
le_top
(Ext Yiiframework Com)
February 11, 2013, 10:57pm
4
Hi
Check out the SQL query that is built. Either by logging to a file or using the Yii Debug Toolbar Extension .
Verify what is going on by testing the query in phpmyadmin for instance and adjust the query until you get results (probably removing some of the conditions). Determine how that should impact your models.
adri00713
(Ralphdanenielsantos)
February 12, 2013, 3:33am
5
how can i test the query ??