|
|
@@ -141,6 +141,13 @@ class AclQueryBuilder {
|
|
|
$this->where[] = '';
|
|
|
return $this;
|
|
|
}
|
|
|
+ public function generateWhereSql() { // @return string - sql without where keyword
|
|
|
+ $sqlWhere = array_filter(
|
|
|
+ array_map([$this, '_generateWhereMain'], $this->where),
|
|
|
+ 'is_string'
|
|
|
+ );
|
|
|
+ return (!empty($sqlWhere)) ? implode("\n\t and ", $sqlWhere) : '';
|
|
|
+ }
|
|
|
|
|
|
public function _generateSelectMain($select, $key) {
|
|
|
if ('__rawSelect__' === $key) return $select;
|
|
|
@@ -182,7 +189,7 @@ class AclQueryBuilder {
|
|
|
if (!$orderBy) return $this;
|
|
|
// ID A,COL_X D,COL_Y A,...
|
|
|
$sortByEx = array_map('trim', explode(',', $orderBy));
|
|
|
- $sortByEx = array_filter($sortByEx, function ($part) { return !empty($part); });
|
|
|
+ $sortByEx = array_filter($sortByEx, ['V', 'filterNotEmpty']);
|
|
|
foreach ($sortByEx as $sortPart) {
|
|
|
$sortPartEx = explode(' ', $sortPart);
|
|
|
if (count($sortPartEx) > 2) throw new Exception("SortBy parse error #" . __LINE__);
|