Model/ResourceModel/Review.php
public function filterItemsForReview($items, $customerId, $order)
    {
        foreach ($items as $key => $item) {
            $productId = $item->getProduct()->getId();

            $collection = $this->reviewFactory->create()->getCollection()
                ->addCustomerFilter($customerId)
                ->addStoreFilter($order->getStoreId())
                ->addFieldToFilter('main_table.entity_pk_value', $productId);

            //remove item if customer has already placed review on this item
            if ($collection->getSize()) {
                unset($items[$key]);
            }
        }

        return $items;
    }
public function filterItemsForReview($items, $customerId, $order)
    {
        foreach ($items as $key => $item) {
            $productId = $item->getProduct()->getId();

            $collection = $this->reviewFactory->create()->getCollection()
                ->addCustomerFilter($customerId)
                ->addStoreFilter($order->getStoreId())
                ->addFieldToFilter('main_table.entity_pk_value', $productId);

            //remove item if customer has already placed review on this item
            if ($collection->getSize()) {
                unset($items[$key]);
            }
        }

        return $items;
    }
public function filterItemsForReview ( $ items , $ customerId , $ order ) { foreach ( $ items as $ key => $ item ) { $ productId = $ item -> getProduct ( ) -> getId ( ) ; $ collection = $ this -> reviewFactory -> create ( ) -> getCollection ( ) -> addCustomerFilter ( $ customerId ) -> addStoreFilter ( $ order -> getStoreId ( ) ) -> addFieldToFilter ( 'main_table.entity_pk_value' , $ productId ) ; //remove item if customer has already placed review on this item if ( $ collection -> getSize ( ) ) { unset ( $ items [ $ key ] ) ; } } return $ items ; }
Filter items for review.

@param array $items
@param int $customerId
@param \Magento\Sales\Model\Order $order

@return mixed
Filter items for review .