/** * 检查连接状态,如果连接断开,则重新连接 */ function check_status() { if (!$this->_db->ping()) { $this->_db->close(); $this->_db->connect(); } }