Compare commits
4 Commits
1.0.4
...
acce5b2b17
Author | SHA1 | Date | |
---|---|---|---|
acce5b2b17 | |||
fc372b56c1 | |||
946a0b0b5e | |||
3b1902ed1a |
@ -105,7 +105,19 @@ abstract class Select extends Query implements SelectInterface
|
||||
}
|
||||
public function getJoinString(): string
|
||||
{
|
||||
return implode(' ', $this->getJoins());
|
||||
$str = [];
|
||||
foreach ($this->getJoins() as $i => $join) {
|
||||
if ($i === 0) {
|
||||
$str []= $join;
|
||||
continue;
|
||||
}
|
||||
if (!str_contains(strtolower($join), 'join')) {
|
||||
$str []= "JOIN {$join}";
|
||||
continue;
|
||||
}
|
||||
$str []= $join;
|
||||
}
|
||||
return implode(' ', $str);
|
||||
}
|
||||
protected array $conditions;
|
||||
public function setConditions(array $conditions): SelectInterface
|
||||
@ -126,7 +138,19 @@ abstract class Select extends Query implements SelectInterface
|
||||
}
|
||||
public function getConditionString(): string
|
||||
{
|
||||
return implode(' ', $this->getConditions());
|
||||
$str = [];
|
||||
foreach ($this->getConditions() as $i => $condition) {
|
||||
if ($i === 0) {
|
||||
$str []= $condition;
|
||||
continue;
|
||||
}
|
||||
if (!str_contains(strtolower($condition), 'and') and !str_contains(strtolower($condition), 'or')) {
|
||||
$str []= "AND {$condition}";
|
||||
continue;
|
||||
}
|
||||
$str []= $condition;
|
||||
}
|
||||
return implode(' ', $str);
|
||||
}
|
||||
protected array $groups;
|
||||
public function setGroups(array $groups): SelectInterface
|
||||
|
Reference in New Issue
Block a user