在Magento集合中使用“具有”问题
我正在尝试在Magento管理模块中为网格构建自定义集合。我创建了一个名为“ addAttributeHaving”的新收集方法,该方法仅执行以下操作: public function addAttributeHaving($value) { $this->getSelect()->having($value); return $this; } 请参阅收集代码: $collection->addFieldToSelect( array( 'entity_id', 'created_at', 'increment_id', 'customer_email', 'customer_firstname', 'customer_lastname', 'grand_total', 'status' ) ); $collection->getSelect()->joinLeft(array('sfop' => 'sales_flat_order_payment'), 'main_table.entity_id = sfop.parent_id', 'sfop.amount_authorized'); $collection->getSelect()->columns('sum(sfop.amount_authorized) AS AUTHD'); $collection->getSelect()->columns('grand_total - sum(sfop.amount_authorized) AS DIF_AU'); $collection->addFieldToFilter('main_table.state', array('in' => array('new','payment_review'))); $collection->addFieldToFilter('main_table.sd_order_type', array('neq' => 7)); $collection->addFieldToFilter('sfop.method', array('neq' => 'giftcard')); …