我遇到了同样的问题,并且能够通过以下方法将其解决到 magento 1.9.2 中:
步骤1:
从app/code/core/Mage/Reports/Model/Resource/Quote/复制Collection.php文件
至
应用程序/代码/本地/法师/报告/模型/资源/报价/
第2步:
从第 194 行替换以下代码
$customerName = $adapter->getConcatSql(array('cust_fname.value', 'cust_mname.value', 'cust_lname.value',), ' ');
$this->getSelect()
->joinInner(
array('cust_email' => $attrEmailTableName),
'cust_email.entity_id = main_table.customer_id',
array('email' => 'cust_email.email')
)
->joinInner(
array('cust_fname' => $attrFirstnameTableName),
implode(' AND ', array(
'cust_fname.entity_id = main_table.customer_id',
$adapter->quoteInto('cust_fname.attribute_id = ?', (int) $attrFirstnameId),
)),
array('firstname' => 'cust_fname.value')
)
->joinInner(
array('cust_mname' => $attrMiddlenameTableName),
implode(' AND ', array(
'cust_mname.entity_id = main_table.customer_id',
$adapter->quoteInto('cust_mname.attribute_id = ?', (int) $attrMiddlenameId),
)),
array('middlename' => 'cust_mname.value')
)
->joinInner(
array('cust_lname' => $attrLastnameTableName),
implode(' AND ', array(
'cust_lname.entity_id = main_table.customer_id',
$adapter->quoteInto('cust_lname.attribute_id = ?', (int) $attrLastnameId)
)),
array(
'lastname' => 'cust_lname.value',
'customer_name' => $customerName
)
);
$this->_joinedFields['customer_name'] = $customerName;
$this->_joinedFields['email'] = 'cust_email.email';
和
$customerName = $adapter->getConcatSql(array('main_table.customer_firstname', 'main_table.customer_middlename', 'main_table.customer_lastname',), ' ');
$this->getSelect()
->columns(
array(
'email' => new Zend_Db_Expr('main_table.customer_email'),
'firstname' => new Zend_Db_Expr('main_table.customer_firstname'),
'middlename' => new Zend_Db_Expr('main_table.customer_middlename'),
'lastname' => new Zend_Db_Expr('main_table.customer_lastname'),
'customer_name' => $customerName
)
)
->where('main_table.customer_email IS NOT NULL');
$this->_joinedFields['customer_name'] = $customerName;
$this->_joinedFields['email'] = 'main_table.customer_email';