Hi All I have following query to be executed. I am executing it as a string sql but is there any way I can convert it into criteria format or proper command format in Yii...
$sql="select * from costing inner join
(select * from storage inner join costing_user_binding psb on user.user=psb.fk_user_id where user.fk_users_id IN $parents_id)
view on costing.costing_id=view.fk_costing_id where costing.fk_user_types_id = {$session['role_level']} and costing.fk_product_types_id=2";
$result = Yii::app()->db->createCommand($sql)->queryAll();