/** * 表名黑名单 * @var array */ protected $blacklistTable = [ ]; //获取数据库中的表名 public function getTableName() { $table_data = Db::query('SHOW TABLES'); foreach ($table_data as $key => $value) { //输出数组中的第一个值 $current = current($value); //去除黑名单 if (!in_array($current, $this->blacklistTable)) { $tableName[] = $current; } } dump($tableName); }