config = \Zend_Registry::get('config'); if(empty($db)) { $this->db = \Zend_Registry::get('db'); }else{ $this->db = $db; } if(empty($auth)) { $this->auth = \Zend_Auth::getInstance(); if($this->auth->hasIdentity()) { $this->user = $this->auth->getIdentity(); } }else{ $this->auth = false; } } //检查用户资料完整性 public function checkinfo() { if($this->auth === false) { return "未登陆"; } include_once("Users.php"); $user = new \Users($this->db); $info = $user->getUserInfo($this->user->id); foreach($this->checkFiled as $v) { if(empty($info[$v])) { return "请完善个人信息"; } } return true; } }