Use backticks for JOIN on OrdersTableQuery

This commit is contained in:
Jorge A. Torres 2023-04-03 13:55:30 -05:00
parent d625f72e2b
commit b156651243
1 changed files with 4 additions and 4 deletions

View File

@ -755,9 +755,9 @@ class OrdersTableQuery {
if ( empty( $on ) ) {
if ( $this->tables['orders'] === $table ) {
$on = "{$this->tables['orders']}.id = {$alias}.id";
$on = "`{$this->tables['orders']}`.id = `{$alias}`.id";
} else {
$on = "{$this->tables['orders']}.id = {$alias}.order_id";
$on = "`{$this->tables['orders']}`.id = `{$alias}`.order_id";
}
}
@ -775,8 +775,8 @@ class OrdersTableQuery {
}
$sql_join = '';
$sql_join .= "{$join_type} JOIN {$table} ";
$sql_join .= ( $alias !== $table ) ? "AS {$alias} " : '';
$sql_join .= "{$join_type} JOIN `{$table}` ";
$sql_join .= ( $alias !== $table ) ? "AS `{$alias}` " : '';
$sql_join .= "ON ( {$on} )";
$this->join[ $alias ] = $sql_join;