Skip to content

Commit

Permalink
qb isUse
Browse files Browse the repository at this point in the history
  • Loading branch information
dp-ifacesoft committed Sep 8, 2020
1 parent 2bc05f0 commit f291bc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 6 additions & 2 deletions source/Ice/Core/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2419,13 +2419,17 @@ public function getWidgets()
* @param $funcName
* @param $argumentString
* @param array $modelTableData
* @param bool $isUse
* @return $this
* @throws Exception
*
* @todo feature using: ->func('fieldAlias', 'funcName', 'funcArgument', $modelTableData)
*/
public function func($funcName, $argumentString, $modelTableData = [])
public function func($funcName, $argumentString, $modelTableData = [], $isUse = true)
{
if (!$isUse) {
return $this;
}

/**
* @var Model $modelClass
*/
Expand Down
9 changes: 3 additions & 6 deletions source/Ice/QueryTranslator/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ protected function translateSelect(Query $query, DataSource $dataSource)
} else {
if ($tableAlias === '') {
$fieldAlias = $fieldName . ' AS `' . $fieldAlias . '`';
} elseif ($fieldName[0] == '\'') {
} elseif ($fieldName[0] === '\'') {
$fieldAlias = $fieldName . ' AS `' . $fieldAlias . '`';
} else {
$fieldAlias = $fieldName . ' AS `' . trim($fieldAlias, '`') . '`';
Expand Down Expand Up @@ -594,8 +594,7 @@ private function getColumnByTimezone($clientTimezone, $column, $alias = null)
/**
* Translate join part
*
* @param array $part
* @param $modelClassTableAlias
* @param Query $query
* @param DataSource $dataSource
* @return string
*
Expand All @@ -620,9 +619,7 @@ protected function translateJoin(Query $query, DataSource $dataSource)
}

foreach ($part as $tableAlias => $joinTable) {
/**
* @var Model $joinModelClass
*/
/** @var Model $joinModelClass */
$joinModelClass = $joinTable['class'];

if ($joinModelClass instanceof QueryBuilder) {
Expand Down

0 comments on commit f291bc4

Please sign in to comment.