Unfortunately you cannot nest AND
condition in OR
with the addFieldToFilter. So you could use Zend_Db_Select::where method to write custom nested queries.
$collection = $this->_orderCollectionFactory->create()
->addFieldToSelect('*');
/* join with payment table */
$collection->getSelect()
->join(
["sop" => "sales_order_payment"],
'main_table.entity_id = sop.parent_id',
array('method')
);
$collection->getSelect()->where(
"status = 'processing' OR (status = 'pending' AND sop.method = 'checkmo')"
);
$collection->addFieldToFilter('updated_at' , ['gteq' => '2019-06-19 18:24:59']);
return $collection;
For more information about addFieldToFilter refer https://magento.stackexchange.com/a/139760/77673
Thanks