【问题标题】:Magento - Select some customer infosMagento - 选择一些客户信息
【发布时间】:2010-12-20 19:37:39
【问题描述】:

出于我开始意识到的模块的目的,我想做一个选择查询,它给我一个或多个客户的地址、姓名和姓氏。

我在数据库 magento 中有点迷失,求助!

【问题讨论】:

    标签: magento


    【解决方案1】:

    您可以使用 getSelect() 方法来回显 magento 所做的每个选择。

    为一位客户

    echo Mage::getModel('customer/customer')->load('id')->getSelect();

    或整个集合

    echo Mage::getModel('customer/customer')->getCollection()->getSelect();

    【讨论】:

    • with : Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('postcode', '70184');我有这个错误:致命错误:调用 C:\xampp\htdocs\site_name\app\code\core\Mage\Eav\Model\Entity\Collection\Abstract.php 中非对象上的成员函数 isStatic()在第 372 行
    • 我实际上没有测试过这个:) 但问题是客户有地址(运输和计费),所以您需要查询地址收集并加入用户信息,反之亦然
    【解决方案2】:

    您必须搜索表 customer_entitycustomer_address_entity

    【讨论】:

    • 是的,我知道,但是当我指定时,例如选择邮政编码为 70184 的客户?我该怎么做?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多