public function subscribeAction(WechatController $weObj) { // TODO 获取用户的信息,并保存到数据库 $UserInfo = $this->userinfoAction($weObj); $weObj->text($UserInfo)->reply(); $user = new User(); $user->save(array("open_id" => $UserInfo[openid], "name" => $UserInfo[nickname], "sex" => $UserInfo[sex], "avatar" => $UserInfo[headimgurl], "create_time" => $UserInfo[CreateTime], "experience" => "200", "integral" => "100", "phone" => "18888888888", "code" => "a000001", "question" => "1")); $newsData = array(0 => array('Title' => 'xx', 'Description' => "xx", 'PicUrl' => 'xx', 'Url' => 'xx')); $weObj->news($newsData)->reply(); }