Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nag0n committed May 26, 2024
2 parents 2716b3a + dcfe6ec commit f86a36a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,11 @@ public function addCondition(string $field, string $operator, $value, string $de
$value = $this->filterParam($value);
}
$name = strtolower($name);

// skip adding the `table.` prefix if it's already there or a function is being supplied.
$skip_table_prefix = (strpos($field, '.') !== false || strpos($field, '(') !== false);
$expressions = new Expressions([
'source' => ('where' === $name ? $this->table . '.' : '') . $field,
'source' => ('where' === $name && $skip_table_prefix === false ? $this->table . '.' : '') . $field,
'operator' => $operator,
'target' => (
is_array($value)
Expand Down

0 comments on commit f86a36a

Please sign in to comment.