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'