7 – Adding conditional comparison of two columns in relationship

I am trying to put value comparision while creating relationship. When i give direct value that works perfectly fine. but i wanted to pass column name with alias to get required results.

This is working fine

$this->query->add_where(
        $this->options('group'),
        db_and()
          ->condition("class.end_time", 1625047346 , '<=')
    );

output
WHERE ((( (class.end_time <= 1625047346) ))AND ……………

This is not working. it takes alias.column as value

$this->query->add_where(
        $this->options('group'),
        db_and()
          ->condition("class.end_time", "class1.end_time" , '<=')
    );

output
WHERE ((( (class.end_time <= ‘class.end_time’) ))AND ……………