_db->select(); $select->from($this->_getPair(), ['id', 'dueDate']); if (!($dates = $this->getFilter('dueDate'))) { throw new Exception('dueDate filter are note defined'); }; $select->join($this->_getPair('Vendor', 'v'), '`v`.`id` = `t`.`vendorId`', [ 'vendorDbaName' => 'dbaName' ]); $select->where('`t`.`dueDate` IN(?)', $dates); $select->where('`t`.`status` = ?', Entity::STATUS_PENDING); $select->order('t.dueDate DESC'); return $select; } }