magento开发 -- 修改当前用户的客户组
Posted ec04
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了magento开发 -- 修改当前用户的客户组相关的知识,希望对你有一定的参考价值。
$customer = Mage::getSingleton(‘customer/session‘)->getCustomer();
$customer->setData( ‘group_id‘, ‘2‘);
$customer->save();
同理,你也可以修改用户的其它信息
[Magento SQL] 获取指定用户组,每个客户历史总订单数量和销售金额
SELECT customer_id,group_id,email,SUM(grand_total) AS total_amount,COUNT(*) AS orders_num FROM sales_flat_order_grid
LEFT JOIN customer_entity ON customer_entity.entity_id = sales_flat_order_grid.customer_id
WHERE `status`=‘complete‘ AND customer_id IS NOT NULL AND customer_entity.group_id = 1
GROUP BY customer_id
ORDER BY orders_num DESC
from: 网络
以上是关于magento开发 -- 修改当前用户的客户组的主要内容,如果未能解决你的问题,请参考以下文章
Magento 2 - SQLSTATE [HY000] [1698] 用户'root'@'localhost'的访问被拒绝