* code for task #2470.

This commit is contained in:
wangyidong
2016-02-24 13:06:59 +08:00
parent a261867468
commit 997f691665
5 changed files with 125 additions and 6 deletions
+25
View File
@@ -17,4 +17,29 @@ class miscModel extends model
{
return 'hello world from hello()<br />';
}
/**
* Get table and status.
*
* @param string $type
* @access public
* @return array|false
*/
public function getTableAndStatus($type = 'check')
{
if($type != 'check' and $type != 'repair') return false;
$tables = array();
$stmt = $this->dao->query("show full tables");
while($table = $stmt->fetch(PDO::FETCH_ASSOC))
{
$tableName = $table["Tables_in_{$this->config->db->name}"];
$tableType = strtolower($table['Table_type']);
if($tableType == 'base table')
{
$tableStatus = $this->dao->query("$type table $tableName")->fetch();
$tables[$tableName] = strtolower($tableStatus->Msg_text);
}
}
return $tables;
}
}