Magento MySQL - “OR”条件为两个addAttributeToFilter()

In Magento I need to get products without special price within a specific category.

Here is what I come up with:

<?php
$dateYesterday = date( 'm/d/y', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 1, date( 'y' ) ) );

$catagoryModel = Mage::getModel( 'catalog/category' )->load( $currentCategoryId );

$productCollection = Mage::getResourceModel( 'catalog/product_collection' );

$productCollection->addAttributeToSelect( 'name' );

$productCollection->addCategoryFilter( $catagoryModel );

$productCollection->addAttributeToFilter( 'special_price', 
    array( 'eq' => '' ) 
);

$productCollection->addAttributeToFilter( 'special_to_date', 
    array( 'date' => true, 'to' => $dateYesterday ) 
);

?>

In the above query, I need to use the "OR" conditional between the two last filters, semantically like this:

$productCollection->addAttributeToFilter( 'special_price', 
array( 'eq' => '' ) );

// OR

$productCollection->addAttributeToFilter( 'special_to_date', 
array( 'date' => true, 'to' => $dateYesterday ) );

In other words:

( special_price = '' OR special_to_date <= $dateYesterday )

Can you help? Thanks!

If I remember well, you need to use an array of conditions to create a OR.
Check out this link to understand what I mean.
In your case you should join your two conditions in one, like this

$productCollection->addAttributeToFilter(
                array(
                    array('attribute'=>'special_price', 'eq'=>''),
                    array('attribute'=>'special_to_date', 'date' => true, 'to' => $dateYesterday )
                )
            );

I have no Magento installation to try this.
Maybe the second condition should be slightly different.

Have a look here (official documentation for using Magento collections)

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/using_collections_in_magento

In your examplle:

$productCollection->addAttributeToFilter(array(
    array(
        'attribute' => 'special_price',
        'eq'        => '',
        ),
    array(
        'attribute' => 'special_to_date',
        'date' => true,
        'to'      => $dateYesterday,
        ),
));