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