i want to use some scope if yii active record model in same model's another scope see the following code, you will understand what i want to say?
public function scopes() {
return array(
'avg_all'=>array(
'select'=>array(
'avg_fp_1'=>'AVG(CASE when t.fp_1>=0 then t.fp_1 ELSE NULL END)',
'avg_fp_2'=>'AVG(CASE when t.fp_2>=0 then t.fp_1 ELSE NULL END)',
'avg_fp_3'=>'AVG(CASE when t.fp_3>=0 then t.fp_1 ELSE NULL END)',
'avg_fp_4'=>'AVG(CASE when t.fp_4>=0 then t.fp_1 ELSE NULL END)',
'avg_fp_5'=>'AVG(CASE when t.fp_5>=0 then t.fp_1 ELSE NULL END)',
),
),
'avg_feedback'=>array(
'with'=>array('avg_all'),
'select'=>array(
'avg_feedback'=>'ROUND((avg_fp_1+avg_fp_2+avg_fp_3+avg_fp_4+avg_fp_5)/5,2)'
)
)
);
}
main problem 'with'=>array('avg_all'),
is it possible to use another scope inside a scope.