开发者

Magento model listing/get function

I'm trying to learn how to use Magento models, but I'm getting very impatient and keep getting interrupted by client phone calls....Can someone just tell me how to achieve the following:

SELECT * FROM usertable WHERE emaillike '%gmail%' and taxnumber = 300
//Then print the results in php

I'm looking for code that might look something like

$model = new UserT开发者_如何学Pythonable();
$results = $model->getWhere(array('email'=>'%gmail%', tax=>300));
print_r($results);

or something to that effect;


$customer = Mage::getModel('customer/customer');
$collection = $customer->getCollection()
            ->addAttributeToFilter('taxvat', 300)
            ->addAttributeToFilter('email', array('like'=>'%gmail%'))
            ->load();
print_r($collection->toArray());

P.S. When you have time the knowledge base makes a good primer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜