Closed garekus closed 12 years ago
$user = YumUser::model()->findByPk($id) - return null, because Yii::app()->user->id; return username not the PK
how about:
if(is_numeric($id)) $user = YumUser::model()->findByPk($id); else $user = YumUser::model()->findByAttributes(array('username' => $id));
Of course, it's more carefully.
$user = YumUser::model()->findByPk($id) - return null, because Yii::app()->user->id; return username not the PK