private static function arraySelect($fields = [], $arr) {
        $result = [];
        $values = [];
        if ($fields === []) {
            foreach ($arr as $index => $row) {
                foreach (array_keys($row) as $c) {
                    $values[$c] = $row[$c];
                }
                if ($values) {
                    $result[$index] = $values;
                }
                $values = [];
            }
        } else {
            foreach ($arr as $index => $row) {
                foreach ((array) $fields as $c) {
                    if ($row[$c]) {
                        $values[$c] = $row[$c];
                    }
                }
                if ($values) {
                    $result[$index] = $values;
                }
                $values = [];
            }
        }
        return $result;
    }