gpt4 book ai didi

date - Magento 1.9 错误的客户创建和上次登录日期

转载 作者:行者123 更新时间:2023-12-02 03:11:20 25 4
gpt4 key购买 nike

我正在运行 Magento v.1.9.0.1,通过管理区域编辑客户时,我遇到了显示日期的问题。例如,

上次登录:7791 年 2 月 11 日 4:23:48 μ.μ.
上次登录(欧洲/ Istanbul 尔):2015 年 2 月 9 日 3:16:31 μ.μ.
帐户创建时间:2015 年 9 月 2 日 4:16:11 μ.μ.

客户于 2015 年 2 月 9 日注册。我搜索了一下,发现了有关其他 Magento 版本的主题,其中提到对于某些日期,Magento 正在交换日期,因此实际创建日期 (09/02/2015) 和报告的日期之间存在差异创建日期(2015 年 2 月 9 日)。

我找不到任何有关版本 1.9 的信息,也找不到任何有关上次登录的报告年份(7791!)的信息。

这个问题有解决办法吗?

感谢您的宝贵时间。

最佳答案

在 Magento 1.8.1 中遇到同样的问题,并针对帐户创建日期和上次登录日期应用了以下解决方案。因为 Magento 在客户编辑部分中将日转换为月以及月至今的一些方式。路径:app\code\core\Mage\Adminhtml\Block\Customer\Edit\Tab\View.php覆盖上面文件中的以下方法:

    public function getCreateDate()
{
$cutomerId = $this->getRequest()->getParam('id');
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$select = $connection->select()
->from('customer_entity', array('created_at'))
->where('entity_id=?',$cutomerId);
$rowArray = $connection->fetchRow($select);

return $this->_getCoreHelper()->formatDate($rowArray['created_at'],
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}

public function getStoreCreateDate()
{
$cutomerId = $this->getRequest()->getParam('id');
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$select = $connection->select()
->from('customer_entity', array('created_at'))
->where('entity_id=?',$cutomerId);
$rowArray = $connection->fetchRow($select);

return $this->_getCoreHelper()->formatDate($rowArray['created_at'],
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}

public function getLastLoginDate()
{
if ($date = $this->getCustomerLog()->getLoginAtTimestamp()) {
$date = Mage::app()->getLocale()->storeDate(
$this->getCustomer()->getStoreId(),
$date,
true
);
return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}
return Mage::helper('customer')->__('Never');
}

关于date - Magento 1.9 错误的客户创建和上次登录日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28454879/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com