Model 1
============
cargo_loader
============
loader_id
loader_name
loader_price
#cargo_loader has many cargo_details
Model 2
============
cargo_details
============
cargo_id
cargo_total
loader_id
#cargo_detailshas many cargo_items
Model 3
============
cargo_items
============
cargo_id
cargo_length
cargo_width
cargo_height
cargo_actualWeight
/************** My Problem ***********************/
i want to view in the cgridview
[cargo_items->cargo_actualWeight] in my cgrid view, but my cgridview provider from "cargo_loader" model
heres my relation of my model "cargo_loader"
public function relations()
{
'cd' => array(self::HAS_MANY,'Cargo_details',array('loader_awb'=>'cargo_id'),'through'=>'dim'),
'ic'=>array(
self::HAS_MANY,'cargoitems',array('cargo_id'=>'cargo_id'),'through'=>'cd'
),
);
}
my cgridview
$this->widget('bootstrap.widgets.TbGridView',array(
'id'=>'sea-sales-monitoring-grid',
'type'=>'striped bordered condensed',
'dataProvider'=>$model->salesReport(),
'columns'=>array(
array(
'filter'=>true,
'name'=>'Act Wt',
'value'=>'sum($data->ic->cargo_actualWeight)'
),
),
));
iwant to get the sum of cargo_actualWeight, and display in cgridview…
thanks in advance