Hello I am a bit new to Yii,
So far i am pretty impressed its so easy to work with and does so much, I am just stuck on a couple of things…
I have a single users table with multiple users in it each of a different type e.g admin and rep, I have related them to my Order model via within the relations function
'rep' => array(self::HAS_ONE, 'User', 'user_id'), 'admin' => array(self::HAS_ONE, 'User', 'user_id'),
But when i try to display them in a list with all the other orders using
$rep=$data->rep;
echo CHtml::encode($rep->first_name.' '.$rep->last_name);
It will only display the names of the first instance of the user.
I am right in just trying to use the one table for all users?
Maybe its something silly.
Thanks for any help,