2017-10-17 6 views
0

私はフィルタに複数のaddFieldToFilterを追加したいと思います。Magento複数のaddFieldToFilter?

これは私が現在持っているものです。

$cards = Mage::getModel('giftcards/giftcards')->getCollection()->addFieldToFilter('order_id', $order->getId()); 
$cards = Mage::getModel('giftcards/giftcards')->getCollection()->AddFieldToFilter('gc_sent', false); 

が、これはこれを行うには正しい方法は何ですか?それとも私は別の方法でやっているべきですか?

ありがとうございます。

+0

https://stackoverflow.com/questions/3826474/magento-addfieldtofilter-two-fields-match-as-or-not-and < - のようなものそれ? – CD001

答えて

1

あなたは次のように複数のフィルタを使用することができ、以下の

$cards = Mage::getModel('giftcards/giftcards')->getCollection() 
       ->addFieldToFilter('order_id', $order->getId()) 
       ->addFieldToFilter('gc_sent', false) 
       ->addFieldToFilter('other_field', 'value'); 
関連する問題