jafaripur
(Mjafaripur)
1
i have this model load with relation.
with this i load users inbox message .
just i want to show custom column for example:
in senderUser relation i have 10 column in model but i want to just select username of message sender.
and in Inbox Model some column i have don’t want to load in this time.
$model = Inbox::model()->with(array('senderUser'))->findAll('receiveuser = :receiveuser', array(':receiveuser' => Yii::app()->user->id));
Why you don’t want to load some columns from the database?
jafaripur
(Mjafaripur)
3
i solve this.
in CGridView how to check a column named readed and changed row color if readed column is false or true ?
shgninc
(Shgninc)
4
Oh, so great check this:
$model = Inbox::model()->
with(array(
'senderUser'=>array(
'select'=> 'id, username'
)
))->findAll(array(
'select'=>'id, some, columns',
'condition'=>'receiveuser = :receiveuser',
'params'=> array(':receiveuser' => Yii::app()->user->id),
) );
I hope it is useful:D.