protected function _initSelect()
    {
        $request = $this->_objectManager->get('Magento\Framework\App\RequestInterface');
        $this->getSelect()->from(['main_table' => $this->getMainTable()]);

        if(!empty($customerId = $request->getParam('id'))) {
            $this->getSelect()->where('customer_id = ?', $customerId);
        }

        return $this;
    }
protected function _initSelect()
    {
        $request = $this->_objectManager->get('Magento\Framework\App\RequestInterface');
        $this->getSelect()->from(['main_table' => $this->getMainTable()]);

        if(!empty($customerId = $request->getParam('id'))) {
            $this->getSelect()->where('customer_id = ?', $customerId);
        }

        return $this;
    }
protected function _initSelect ( ) { $ request = $ this -> _objectManager -> get ( 'Magento\Framework\App\RequestInterface' ) ; $ this -> getSelect ( ) -> from ( [ 'main_table' => $ this -> getMainTable ( ) ] ) ; if ( ! empty ( $ customerId = $ request -> getParam ( 'id' ) ) ) { $ this -> getSelect ( ) -> where ( 'customer_id = ?' , $ customerId ) ; } return $ this ; }
Init collection select

@return $this
Init collection select