Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group BY #40

Open
MrG0LD3 opened this issue Jul 12, 2024 · 0 comments
Open

Group BY #40

MrG0LD3 opened this issue Jul 12, 2024 · 0 comments

Comments

@MrG0LD3
Copy link

MrG0LD3 commented Jul 12, 2024

No ficheiro Editor.php, adicionar procurar as linhas

/** @var string Action name allowing for configuration */
private $_actionName = 'action';

e adicionar após

/** @var string */
private $_group_by = '';

Adicionar a função

/**
 * @param string $column
 *
 * @return ($column is null ? string[] : $this) Where condition array.
 */
public function groupBy($column) {

    if ($column === null) {
        return $this->_group_by;
    }

    $this->_group_by = $column;

    return $this;
}

Na função
private function _get($id = null, $http = null)

Procurar a linha $ssp = $this->_ssp_query($query, $http); e adicionar depois da mesma

if($this->_group_by != '')
    $query->group_by($this->_group_by);

if ($id !== null) {
    $query->where($this->pkeyToArray($id, true));
}

Pode ser sempre melhorada foi uma alteração que fiz para poder usar o group by no editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant