magento2: shows the most recently added products that are configured to show on this website

Magento 2.1.6
I have a module that fills a specific category with the "last 200" new elements added to my magento database.
However, it has a problem because it does not take into account the "Product on site" attribute against each product. Therefore, any item that has not yet been assigned to the website is still counted among the 200 products I intend to display. In that case, there will be missing products from the page since they will not be displayed. No problem unless you want to add another 10,000 items to your magento database, but do not show them on this website! My 200 most recent articles will actually show zero articles in this case.

This is the part of the code that brings together the collection of products, but I think it is necessary to go back to work to take into account the problem described above and also to always contain 200 products in the resulting collection.

if ($ catID == 571 && $ catID! == "") {
$ request = $ objectManager-> create (& # 39; Magento  Framework  App  Request  Http & # 39;);
$ productCollection = $ objectManager-> create (& # 39; Magento  Catalog  Model  ResourceModel  Product  CollectionFactory & # 39;);
$ _productCollectionlastitem = $ productCollection-> create () -> setPageSize (1) -> addAttributeToSelect (& # 39;) & # 39;) -> addAttributeToSort (& # 39; entity_id & # 39 ;, & # 39; desc & # 39 ;)
-> load ();
$ lastid = $ _productCollectionlastitem-> getFirstItem () -> getId ();
$ startid = $ lastid - 200;
$ storeid = 1;
$ _productCollection = $ productCollection-> create ()
-> setPageSize (36)
-> setCurPage ($ request-> getParam ("p"))
-> addAttributeToSelect (& # 39; * & # 39;)
-> addStoreFilter ($ storeid)
-> addAttributeToFilter (& # 39; visibility & # 39 ;,  Magento  Catalog  Model  Product  Visibility :: BOTH VISIBILITY)
-> addAttributeToFilter (& # 39; status & # 39 ;,  Magento  Catalog  Model  Product  Attribute  Source  Status :: STATUS_ENABLED)
-> addAttributeToFilter (& # 39; image & # 39 ;, array ("neq" => & # 39; no_selection & # 39;))
-> addAttributeToFilter (& # 39; entity_id & # 39 ;, array (
& # 39; from & # 39; => $ startid,
& # 39; a & # 39; => $ lastid
));
if ($ request-> getParam ("product_list_order_order")) {
$ _productCollection-> addAttributeToSort ($ request-> getParam ("product_list_order"), "asc");
} else {
$ _productCollection-> addAttributeToSort (& # 39; entity_id & # 39 ;, "desc");
}
$ _productCollection-> addUrlRewrite ();
//
$ _productCollection-> load ();

returns $ _productCollection;
}

I think the way in which this collection is assembled is incorrect, starting with the most recent identification number of the products, but I'm not sure how I can fix it.

Could someone clarify how this code could change to solve this problem?