protected static function getUserInfo() { if (empty(self::$resource)) { throw new Exception("Resource can not be empty", 1); } if (!($db = Vera_Database::getInstance())) { throw new Exception("Cannot get instance of database", 1); } $result = $db->select('vera_User', '*', array('wechat_id' => self::$resource['openid'])); if (!$result) { self::$userInfo = -1; return NULL; } self::$userInfo = $result[0]; return $result[0]; }