Hello,
i spent whole morning on searching the answer to my questions but no results.
Basically i want to get only 2 columns from db. One primary key, and second that is name and surname joined together
the sql would be:
"SELECT loginname, concat(fname,' ',lname)as fullname FROM it_users"
so i made the method in Model:
public function findFullname() {
return self::model()->findBySql('SELECT loginname, concat(fname," ",lname)as fullname FROM it_users');
}
After that i have only loginname attribute available. What should i do to use fullname too?
I know that i should add the property ‘fullname’ to the model, but how?