public function __construct(){ parent::__construct(); $agent = $_SERVER['HTTP_USER_AGENT']; if (!strpos($agent, "MicroMessenger")) { //echo '此功能只能在微信浏览器中使用';exit; } //$this->token = isset($_REQUEST['token']) ? htmlspecialchars($_REQUEST['token']) : '';//$this->_get('token'); //$this->assign('token', $this->token); //$this->wecha_id = isset($_REQUEST['wecha_id']) ? $_REQUEST['wecha_id'] : ''; //$this->assign('wecha_id', $this->wecha_id); $this->wecha_id = isset($_REQUEST['wecha_id']) ? htmlspecialchars($_REQUEST['wecha_id']) : '';//$this->wecha_id; $this->token = isset($_REQUEST['token']) ? htmlspecialchars($_REQUEST['token']) : '';//$this->_get('token'); $this->_rid = isset($_REQUEST['reid']) ? intval($_REQUEST['reid']) : 0; if ($this->_research = M('Research')->where(array('id' => $this->_rid, 'token' => $this->token))->find()) { $this->assign('research', $this->_research); $this->assign('rid', $this->_rid); $this->assign('metaTitle', $this->_research['title']); } else { exit('调研不存在'); } }