Files
Django/merchant_ops/sql/seed_permissions.sql
XingQue d68a1da2c2 第二轮:客服额度资金闭环与收回额度
- 划额度扣商家余额,客服派单/链接只扣个人额度
- 新增 wallet/revoke 收回未使用额度,权限 wallet_revoke
- 客服额度单撤销/退款只释放额度,不再误退商家余额
- 链接待填单(13)可撤销;总管/财务可划收额度
2026-06-20 04:59:29 +08:00

33 lines
1.7 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 商家子客服:权限码初始化(部署后执行一次,或使用 python manage.py seed_merchant_staff
-- 表 merchant_staff_permission
INSERT INTO merchant_staff_permission (perm_code, perm_name, sort_order, status, CreateTime, UpdateTime) VALUES
('staff_manage', '子客服管理', 0, 1, NOW(), NOW()),
('role_manage', '角色管理', 1, 1, NOW(), NOW()),
('wallet_allocate', '划额度', 2, 1, NOW(), NOW()),
('wallet_revoke', '收回额度', 3, 1, NOW(), NOW()),
('wallet_view', '查看额度', 4, 1, NOW(), NOW()),
('finance_view', '查看商家余额', 4, 1, NOW(), NOW()),
('order_dispatch', '派单发单', 5, 1, NOW(), NOW()),
('order_view_all', '查看全部订单', 6, 1, NOW(), NOW()),
('order_view_self', '只看自己派的单', 7, 1, NOW(), NOW()),
('order_detail', '订单详情', 8, 1, NOW(), NOW()),
('order_settle', '结单', 9, 1, NOW(), NOW()),
('order_refund_apply', '申请退款', 10, 1, NOW(), NOW()),
('order_cancel', '撤销订单', 11, 1, NOW(), NOW()),
('order_change_player', '换打手', 12, 1, NOW(), NOW()),
('penalty_apply', '申请罚单', 13, 1, NOW(), NOW()),
('penalty_manage', '改撤罚单', 14, 1, NOW(), NOW()),
('penalty_view', '查看罚单', 15, 1, NOW(), NOW()),
('staff_disable', '封禁解封客服', 16, 1, NOW(), NOW()),
('template_manage', '派单模板', 17, 1, NOW(), NOW()),
('audit_view', '操作日志', 18, 1, NOW(), NOW()),
('rank_view', '客服排行榜', 19, 1, NOW(), NOW()),
('im_chat', '订单IM', 20, 1, NOW(), NOW()),
('stats_view', '统计数据', 21, 1, NOW(), NOW())
ON DUPLICATE KEY UPDATE perm_name=VALUES(perm_name), sort_order=VALUES(sort_order);
-- 推荐:执行完 SQL 后运行
-- python manage.py seed_merchant_staff
-- 会自动创建系统角色模板及角色-权限关联