次のようなフィルタを作成したいと思います:(
疑似コード)
SELECT * FROM Products WHERE
(`attribute_foo` LIKE 'bar' AND `attribute_bar` LIKE 'foo')
OR (`attribute_far` LIKE 'boo');
OR
配列を提供して条件を構築する方法は知っていますが、両方は知りません。
ありがとうございます
次のようなフィルタを作成したいと思います:(
疑似コード)
SELECT * FROM Products WHERE
(`attribute_foo` LIKE 'bar' AND `attribute_bar` LIKE 'foo')
OR (`attribute_far` LIKE 'boo');
OR
配列を提供して条件を構築する方法は知っていますが、両方は知りません。
ありがとうございます
"from"=>$fromValue, "to"=>$toValue
"like"=>$likeValue
"neq"=>$notEqualValue
"in"=>array($inValues)
"nin"=>array($notInValues)
"eq"=>$equal
"nlike"=>$notlike
"is"=>$is
"gt"=>$greaterthan
"lt"=>$lessthan
"gteq"=>$greterthanequal
"lteq"=>$lessthanequal
"finset"=>$unknown
"date"=>true, "to" => $now
$collection = Mage::getResourceModel('customer/customer_collection')
->addNameToSelect()
->addAttributeToSelect('email')
->addAttributeToSelect('created_at')
->addAttributeToSelect('group_id')
->addFieldToFilter('entity_id', array('from'=>20, 'to'=>30))
->addFieldToFilter('name', array('like'=>'%cindy%'));
Magento データ オブジェクトを使用して、以下をフィルタリングできます。
$product = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToFilter("attribute_code", $value);
print_r($product->getItems());