Have you tried to specify your custom field in select property of CDbCriteria
?
'select' => array(
..., // fields to select
'(<calculations>) AS cur_margin'
)
You don't have to declare getCur_margin() method then but only declare a public $cur_margin
member in your model. All required calculations will be done in SQL query.
You can also refer to this thread as an example.