指定JOIN查询字段
@access public
@param $join
@param string|array|bool $field 查询字段
@param string|array $on    JOIN条件
@param string       $type  JOIN类型
@return $this
507551
public function view($join, $field = true, $on = null, $type = 'INNER')
    {
        $this->options['view'] = true;
        if (is_array($join) && key($join) !== 0) {
            foreach ($join as $key => $val) {
                $this->view($key, $val[0], isset($val[1]) ? $val[1] : null, isset($val[2]) ? $val[2] : 'INNER');
            }
        } else {
            $fields = [];
            $table  = $this->getJoinTable($join, $alias);

            if (true === $field) {
                $fields = $alias . '.*';
            } else {
                if (is_string($field)) {
                    $field = explode(',', $field);
                }
                foreach ($field as $key => $val) {
                    if (is_numeric($key)) {
                        $fields[]                   = $alias . '.' . $val;
                        $this->options['map'][$val] = $alias . '.' . $val;
                    } else {
                        if (preg_match('/[,=\.\'\"\(\s]/', $key)) {
                            $name = $key;
                        } else {
                            $name = $alias . '.' . $key;
                        }
                        $fields[$name]              = $val;
                        $this->options['map'][$val] = $name;
                    }
                }
            }
            $this->field($fields);
            if ($on) {
                $this->join($table, $on, $type);
            } else {
                $this->table($table);
            }
        }
        return $this;
    }
792501
function join($table_or_column, $on_clause_or_column = null, $join_type = self::JOIN) {
		return $this->addJoin($table_or_column, $on_clause_or_column, $join_type);
	}
1068202
function join (table, args, type) {
    this.typecheck && t.typecheck('join', [table, args, type]);
    if ('string'===typeof args) args = [args];
    var result = ['join',table,'on',args.join(' and ')];
    if (type) result.splice(0,0,type);
    return result.join(' ');
}
902587
public function rightJoin($table, $on, $joinField = null)
    {
        return $this->join($table, $on, $joinField, 'RIGHT');
    }
620631
public function straightJoin($table, array $fields, array $on = []) {
        return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);
    }
826601
public function addJoin(string $tableKey, string $type, ?string $source, $table, ?string $alias, $on = null, array $params = [])
    {
        $this->join[$tableKey] = [
            'type'   => $type,
            'source' => $source,

            'table' => $table,
            'alias' => $alias,

            'on'     => $on,
            'params' => $params,
        ];

        return $this;
    }
56973
public function join($join, $condition = null, $type = 'INNER')
    {
        if (empty($condition)) {
            // 如果为组数，则循环调用join
            foreach ($join as $key => $value) {
                if (is_array($value) && 2 <= count($value)) {
                    $this->join($value[0], $value[1], isset($value[2]) ? $value[2] : $type);
                }
            }
        } else {
            $table = $this->getJoinTable($join);

            $this->options['join'][] = [$table, strtoupper($type), $condition];
        }

        return $this;
    }
1229705
protected function setDataType(Field & $field, $type)
    {
        $map = $this->dataTypeMap();

        if (array_key_exists($type, $map)) {
            $field->dataType = $map[$type];
        }

        return $this;
    }
991959
public function join($table, $criteria = null, $type = self::INNER_JOIN, $alias = null)
    {
        if (!$this->isJoinUnique($table, $alias)) {
            return $this;
        }

        if (is_string($criteria)) {
            $criteria = array($criteria);
        }

        $this->join[] = array('table' => $table,
            'criteria' => $criteria,
            'type' => $type,
            'alias' => $alias);

        return $this;
    }
979168
public function join(string $table, string $condition, string $type=''): QueryBuilderInterface
	{
		// Prefix and quote table name
		$table = explode(' ', mb_trim($table));
		$table[0] = $this->driver->quoteTable($table[0]);
		$table = $this->driver->quoteIdent($table);
		$table = implode(' ', $table);

		// Parse out the join condition
		$parsedCondition = $this->parser->compileJoin($condition);
		$condition = $table . ' ON ' . $parsedCondition;

		$this->state->appendMap("\n" . strtoupper($type) . ' JOIN ', $condition, 'join');

		return $this;
	}
1295774
public function join($type, $table, $condition, $arguments = array())
    {
        $this->join[] = [
            'type' => $type,
            'table' => $table,
            'condition' => $condition,
            'arguments' => $arguments,
        ];
        return $this;
    }
1028154
public function joinByField(Field $field, $join_array)
    {
        $fieldType = $field->getFieldType();
        $type_name = $fieldType->getName();
        $field_name = $field->getName();

        $table_name = '';

        if(array_key_exists($type_name, $this->table_names))
        {
            $table_name = $this->table_names[$type_name];
        }
        else
        {
            throw new ScalarException('Нет соответствия таблицы для типа '.$type_name.'!');
        }

        $join_q = new QueryBuilder(DB::table($table_name));

        $join_q->select([$table_name.'.entity_name', $table_name.'.entity_id', $table_name.'.value as '.$join_array['full_field_names'][0]]);//Законцовка - в массиве только одно поле x_..x_id
        $join_q->whereRaw($table_name.'.name = "'.$field_name.'"');

        return $join_q;
    }
354371
public function rightJoin($join, $on = null): TableCached
    {
        $this->statement->join('right', $join, $on);
        return $this;
    }
653258
public function addJoin(Expression $foreign, Statement\Where $on, $joinType = Joins::INNER)
    {
        $this->getJoinStatement()->add($foreign, $on, $joinType);
        
        return $this;
    }
1303344
public function join($table, $on = null, $where = null, $binds = [])
    {
        if (!$on) {
            $this->join[] = $table;
        } else {
            $this->join[] = $table . (strpos($table, ' ON ') ? ' AND ' : ' ON ') . $on;
        }

        if ($where) {
            $this->where(new Raw($where));
        }

        if ($binds) {
            foreach ($binds as $bind) {
                $this->bind($bind, 'join');
            }
        }

        return $this;
    }
1353475
public function externalJoin(Field $field, $join_array)
    {
        //Получение типа поля
        $family = $field->getFieldTypeFamily();

        //Обращение к агенту
        $joiner = $this->getJoiner($family);

        //Тип передаем на тот случай, если агент обрабатывает более одного типа, и ему надо будет решить как быть дальше
        $sub_q = $joiner->joinByField($field, $join_array);

        return $sub_q;
    }
372068
public function mergeWithCollection(EntityRepository $collection, $join_on_key, $join_index = 'id', $join_type = 'INNER'): self
    {
        $this->addJoinTable($collection->getDbTableName(), $join_index, $join_on_key, $join_type);
        $this->mergeCollectionSqlSelectWithAnotherCollection($collection);

        return $this;
    }