Generate {prefix}.{field} {alias}.

@param string $prefix
@param string $field
@param string $alias

@return string
350561
private function generateSelect($prefix, $field, $alias = '')
    {
        $format = '%s.%s %s';

        return sprintf($format, $prefix, $field, $alias);
    }
433168
public function prefix(string $prefix): Route
	{
		if(!empty($prefix))
		{
			$this->prefix .= '/' . trim($prefix, '/');
		}

		return $this;
	}
457754
public function bind(string $field, $value, string $prefix = ''): string
    {
    	if ($this->bindings === null) {
    		$this->bindings = new Bindings();
	    }

    	$parameter = $prefix . $field;
    	$bindName = $this->bindings->makeAndSet($parameter, $value);
        return $bindName;
    }
906756
public static function canonquery($query, $prefix = '')
    {
        parse_str(preg_replace('#^\?#', '', $query), $args);

        if (empty($args)) {
            return '';
        }

        ksort($args);
        return $prefix . http_build_query($args);
    }
529988
protected function CreateField($name, $prefix = '', $alias = '')
    {
        return new Field($this->connection, $name, $prefix, $alias);
    }
1071202
public function addField($field, $alias = null)
    {
        if (isset($this->addFieldStrategies[$field])) {
            $this->addFieldStrategies[$field]->addField($this->getCollection(), $field, $alias);

            return ;
        }
        parent::addField($field, $alias);
    }
616006
private function _generateSql($prefix = '')
    {
        $sql = $this->_loadSqlFile();
        $prefix = empty($prefix)? '' : $prefix . '_';
        $sql = str_replace('###', $prefix, $sql);
        $sqlArr = explode(';', $sql);
        if (Db::batchQuery($sqlArr) === false) {
            return false;
        }
        return true;
    }
1283165
protected function getFullFieldName($field, $alias = self::DEFAULT_TABLE_ALIAS, $separator = '.')
    {
        return sprintf('%s%s%s', $alias, $separator, $field);
    }
32473
private function generateJoins($fieldParts, $prefix)
    {
        $i = 0;
        $result = '';
        while ($i <= count($fieldParts) - 2) {
            if (!in_array($fieldParts[$i], $this->prefixes)) {
                $result .= $this->generateJoin(
                    (0 == $i) ? $prefix : $fieldParts[$i - 1],
                    $fieldParts[$i],
                    $fieldParts[$i]
                );
                $this->prefixes[] = $fieldParts[$i];
            }
            ++$i;
        }

        return $result;
    }
190504
public function field($field, $except = false, $tableName = '', $prefix = '', $alias = '')
    {
        if (empty($field)) {
            return $this;
        }

        if (is_string($field)) {
            if (preg_match('/[\<\'\"\(]/', $field)) {
                return $this->fieldRaw($field);
            }
            $field = array_map('trim', explode(',', $field));
        }

        if (true === $field) {
            // 获取全部字段
            $fields = $this->getTableFields($tableName);
            $field  = $fields ?: ['*'];
        } elseif ($except) {
            // 字段排除
            $fields = $this->getTableFields($tableName);
            $field  = $fields ? array_diff($fields, $field) : $field;
        }

        if ($tableName) {
            // 添加统一的前缀
            $prefix = $prefix ?: $tableName;
            foreach ($field as $key => &$val) {
                if (is_numeric($key) && $alias) {
                    $field[$prefix . '.' . $val] = $alias . $val;
                    unset($field[$key]);
                } elseif (is_numeric($key)) {
                    $val = $prefix . '.' . $val;
                }
            }
        }

        if (isset($this->options['field'])) {
            $field = array_merge((array) $this->options['field'], $field);
        }

        $this->options['field'] = array_unique($field);

        return $this;
    }
501679
public function _prefix($name, $prefix)
    {
        list($alias, $field) = $this->undot($name);
        return $alias ? $name : "{$prefix}.{$field}";
    }
1103449
public function formatHeaderAndRemovePrefix($header, $prefix = 'HTTP_') {
        if (str_starts_with($header, $prefix)) {
            $header = substr($header, strlen($prefix));
        }

        return $this->formatHeader($header);
    }
820230
protected function getFieldName($alias)
    {
        $name = $this->getOption('field');

        if ($this->getOption('auto_alias') && !preg_match('/\./', $name)) {
            $name = "$alias.$name";
        }

        return $name;
    }
782446
private function prefix($prefix)
    {
        if ($prefix) {
            $prefixLastChar = substr($prefix, -1);

            if ($prefixLastChar != '.' && $prefixLastChar != ':') {
                $prefix .= '.';
            }
        }

        return $prefix;
    }
645596
public function prefix($prefix) {
		// Reset values before matching.
		$this->prefix = $this->parentPrefix;
		$this->requestPathOffset = $this->parentRequestPathOffset;
		if ($this->parentPrefixMatched) {
			$this->prefixMatched = $this->parentPrefixMatched;
		}

		if (!$this->result->hasHandler() && $this->prefixMatched) {
			$this->prefixMatched = $this->matchPartial($prefix);
		}

		$this->prefix .= $prefix;

		return $this;
	}
488738
public function fields($field, $tableName = '', $alias = '') {
        if (empty($field)) {
            return $this;
        }
        if (is_string($field)) {
            $field = array_map('trim', explode(',', $field));
        }
        $real_field = [];
        foreach ($field as $val) {
            if ($tableName) {
                $val = $tableName . '.' . $val . ($alias ? ' AS ' . $alias . '_' . $val : '');
            }
            $real_field[] = $val;
        }

        $this->fields = array_merge($this->fields, $real_field);
        return $this;
    }
703051
def get_alias(self):
        
        alias = None
        if self.alias:
            alias = self.alias
        elif self.auto_alias:
            alias = self.auto_alias

        if self.table and self.table.prefix_fields:
            field_prefix = self.table.get_field_prefix()
            if alias:
                alias = '{0}__{1}'.format(field_prefix, alias)
            else:
                alias = '{0}__{1}'.format(field_prefix, self.name)

        return alias