@@ 23-25 (lines=3) @@ | ||
20 | foreach ($select as $item) { |
|
21 | if ('colref' === $item['expr_type']) { |
|
22 | $value = $this->getValueWithoutQuotes($item); |
|
23 | if (isset($item['alias']) && is_array($item['alias'])) { |
|
24 | $value .= ' AS '.$this->getValueWithoutQuotes($item['alias'], 'name'); |
|
25 | } |
|
26 | $s[] = $value; |
|
27 | } elseif ('aggregate_function' === $item['expr_type'] || 'function' === $item['expr_type']) { |
|
28 | $function = strtoupper($item['base_expr']); |
|
@@ 30-32 (lines=3) @@ | ||
27 | } elseif ('aggregate_function' === $item['expr_type'] || 'function' === $item['expr_type']) { |
|
28 | $function = strtoupper($item['base_expr']); |
|
29 | $value = $function.'('.implode(', ', array_column($item['sub_tree'], 'base_expr')).')'; |
|
30 | if (isset($item['alias']) && is_array($item['alias'])) { |
|
31 | $value .= ' AS '.$item['alias']['name']; |
|
32 | } |
|
33 | ||
34 | $generator = new Generator('DB'); |
|
35 | $generator->addFunction('raw', [$value]); |
@@ 21-23 (lines=3) @@ | ||
18 | foreach ($from as $item) { |
|
19 | if (in_array($item['join_type'], ['LEFT', 'RIGHT'], true)) { |
|
20 | $table = $this->getValueWithoutQuotes($item, 'table'); |
|
21 | if (isset($item['alias']) && is_array($item['alias'])) { |
|
22 | $table .= ' AS '.$this->getValueWithoutQuotes($item['alias'], 'name'); |
|
23 | } |
|
24 | if ('ON' === strtoupper($item['ref_type'])) { |
|
25 | $args = [ |
|
26 | $table, |