components/Connection.php
public function getColumns($tableName, $restrict = [])
    {
        $sql = "SHOW FULL COLUMNS FROM `{$tableName}`";
        if ($restrict) {
            $sql .= " WHERE Field NOT IN ('" . join("','", $restrict) . "')";
        }
        return $this->createCommand($sql)->queryAll();
    }
public function getColumns($tableName, $restrict = [])
    {
        $sql = "SHOW FULL COLUMNS FROM `{$tableName}`";
        if ($restrict) {
            $sql .= " WHERE Field NOT IN ('" . join("','", $restrict) . "')";
        }
        return $this->createCommand($sql)->queryAll();
    }
Получить расширенную информацию о колонках $tableName, исключая $restrict-columns
@param string $tableName
@param array $restrict
@return array
@throws \yii\db\Exception