我是 yii 的新手,我在 CGridView 中调用一个函数来显示列中的值。但是我也无法为其他列获得该值。我三次调用相同的函数(TblPaid::model()->alreadyPaidUpto())。我想调用一次函数并再次使用该值。这是 CGridView Columns 的摘录。有人可以请。给我一个提示?
array('name'=>'Paid upto this Date',
'value'=>'number_format((TblPaid::model()->alreadyPaidUpto($data->id, $this->grid->extraparam)),2)','htmlOptions'=>array('style'=>'text-align: right'),
),
array('name'=>'Balance',
'value'=>'number_format($data->amount-(TblPaid::model()->alreadyPaidUpto($data->id, $this->grid->extraparam)),2)','htmlOptions'=>array('style'=>'text-align: right'),
),
array(
'header'=>'Running Balance',
'class'=>'RunningTotalColumn',
'value'=>'$data->amount-(TblPaid::model()->alreadyPaidUpto($data->id, $this->grid->extraparam))',
'htmlOptions'=>array('style'=>'text-align: right'),
),