public function index() { $openid = get_user_open_id(); $openid = '' . $openid; $mMember = D('M/Member'); $result = $mMember->GetByOpenid($openid); //echo dump($result); if (!$result) { $this->redirect('Home/selectreg'); exit; } else { //更新session session("cardid", $result["CardId"]); session("uid", $result["uid"]); session("Mobile", $result["Mobile"]); session("MemberItem", $result); } //生新查询头像 $userimg = '' . session("userimg"); if (strlen($userimg) < 10) { $wxm = new WxUserInfo(); $userimg = $wxm->callback($openid); if (strlen($userimg) > 10) { session("userimg", $userimg); //更新到对像 $mMember->ChangeImgPath($openid, $userimg); } } $this->assign('headimgurl', $userimg); $this->assign('tabid', 'member'); $this->assign('title', "个人中心"); $this->assign('data', $result); $this->display(); }