<?php
/**
 * Created by JetBrains PhpStorm.
 * User: yzxh24
 * Date: 12-2-3
 * Time: 下午3:37
 * To change this template use File | Settings | File Templates.
 */
class UpdateAction extends BaseAction
{
    public function run()
    {
        $uid = Yii::app()->request->getQuery('id');
        $member = Member::model()->findByPk($uid);
        $field = MemberData::model()->find(array('condition'=>'uid=:uid','params'=>array(':uid'=>$uid)));
        $group = UserGroup::model()->find(array('condition'=>'groupid=:gid', 'params'=>array(':gid'=>$member->groupid)));

        $medals = Front::getMemberMedals($field->medals);

        $this->getController()->render('update', array(
                'member' => $member,
                'field' => $field,
                'group' => $group,
                'medals' => $medals,
            )
        );
    }
}