Skip to content

For having() method library adds a prefix #146

@mrcnpdlk

Description

@mrcnpdlk

If the table has alias defined, the having() method adds the prefix before the key.
I think it shouldnt.

$qb
    ->newQuery()
    ->table(['p_table'=>'p'])
    ->select([
        'p.id'=>'id',
        $qb->raw('DATE(p.signTime) as docDate')
    ])
    ->having('docDate','=','2021-06-24')
    ->get();

I have the error:
Unknown column 'p.docDate' in 'having clause'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions