_getCountUsageSubselect()) . ')'; return $columns; } protected function _getCountUsageSubselect() { $select = $this->_db->select(); $select->from($this->_getPair('CartItemPromo'), 'COUNT(*)'); $select->join( $this->_getPair('Cart'), '`Cart`.`id` = `CartItemPromo`.`cartId`', [] ); $select->where('`CartItemPromo`.`promoId` = `' . $this->_tableAlias . '`.`id`'); $select->where('`Cart`.`transactionId` IS NOT NULL'); return $select; } }