Merge branch 'main' of gitea.haiyihy.com:hy/hyapp-server
This commit is contained in:
commit
d64efbc23a
@ -2,50 +2,30 @@ SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|||||||
|
|
||||||
SET @now_ms = CAST(UNIX_TIMESTAMP(UTC_TIMESTAMP(3)) * 1000 AS UNSIGNED);
|
SET @now_ms = CAST(UNIX_TIMESTAMP(UTC_TIMESTAMP(3)) * 1000 AS UNSIGNED);
|
||||||
|
|
||||||
-- 收益策略模板是 Lalu/Huwaa/Fami 共用的产品配置入口。默认文档放在 merge 左侧,既能创建 agency 对象,
|
-- 收益策略模板是 Lalu/Huwaa/Fami 共用的产品配置入口。存量模板显式补 0,避免旧实例重发时产生新分成。
|
||||||
-- 又不会覆盖已存在的配置;旧实例重发仍保持 0 分成和 charge_amount 守恒口径。
|
|
||||||
UPDATE admin_policy_templates
|
UPDATE admin_policy_templates
|
||||||
SET rule_json = JSON_MERGE_PATCH(
|
SET rule_json = JSON_SET(rule_json, '$.agency.point_ratio_percent', 0),
|
||||||
CAST('{"agency":{"point_ratio_percent":0,"share_base":"charge_amount"}}' AS JSON),
|
|
||||||
rule_json
|
|
||||||
),
|
|
||||||
updated_at_ms = @now_ms
|
updated_at_ms = @now_ms
|
||||||
WHERE template_code = 'first_google70000_coin_seller_92000_100000_v1'
|
WHERE template_code = 'first_google70000_coin_seller_92000_100000_v1'
|
||||||
AND template_version = 'v1'
|
AND template_version = 'v1'
|
||||||
AND (JSON_EXTRACT(rule_json, '$.agency.point_ratio_percent') IS NULL
|
AND JSON_EXTRACT(rule_json, '$.agency.point_ratio_percent') IS NULL;
|
||||||
OR JSON_EXTRACT(rule_json, '$.agency.share_base') IS NULL);
|
|
||||||
|
|
||||||
UPDATE admin_policy_template_versions
|
UPDATE admin_policy_template_versions
|
||||||
SET rule_json = JSON_MERGE_PATCH(
|
SET rule_json = JSON_SET(rule_json, '$.agency.point_ratio_percent', 0),
|
||||||
CAST('{"agency":{"point_ratio_percent":0,"share_base":"charge_amount"}}' AS JSON),
|
|
||||||
rule_json
|
|
||||||
),
|
|
||||||
updated_at_ms = @now_ms
|
updated_at_ms = @now_ms
|
||||||
WHERE template_code = 'first_google70000_coin_seller_92000_100000_v1'
|
WHERE template_code = 'first_google70000_coin_seller_92000_100000_v1'
|
||||||
AND template_version = 'v1'
|
AND template_version = 'v1'
|
||||||
AND (JSON_EXTRACT(rule_json, '$.agency.point_ratio_percent') IS NULL
|
AND JSON_EXTRACT(rule_json, '$.agency.point_ratio_percent') IS NULL;
|
||||||
OR JSON_EXTRACT(rule_json, '$.agency.share_base') IS NULL);
|
|
||||||
|
|
||||||
-- Fami 的礼物类型先决定主播实际 POINT 收益,再由平台按该收益额外给 Agency owner 20%。内层 JSON_SET
|
-- Fami 从同一份公共政策结构派生独立模板,默认 20%;运营可在 Admin 编辑并发布,不需要改代码。
|
||||||
-- 先确保 host/agency 父对象存在,外层再写嵌套字段,避免 MySQL 对不存在父路径静默忽略,同时保留其他规则。
|
|
||||||
INSERT INTO admin_policy_templates (
|
INSERT INTO admin_policy_templates (
|
||||||
template_code, template_version, name, status, rule_json, description,
|
template_code, template_version, name, status, rule_json, description,
|
||||||
created_by_admin_id, updated_by_admin_id, created_at_ms, updated_at_ms
|
created_by_admin_id, updated_by_admin_id, created_at_ms, updated_at_ms
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
'fami_guild_revenue_policy', 'v1', 'Fami 公会收益政策', 'active',
|
'fami_guild_revenue_policy', 'v1', 'Fami 公会收益政策', 'active',
|
||||||
JSON_SET(
|
JSON_SET(rule_json, '$.agency.point_ratio_percent', 20),
|
||||||
JSON_SET(
|
'Fami 主播与 Agency POINT 收益政策;Agency 默认 20%,以发布后的运行快照为准。',
|
||||||
rule_json,
|
|
||||||
'$.host', COALESCE(JSON_EXTRACT(rule_json, '$.host'), JSON_OBJECT()),
|
|
||||||
'$.agency', COALESCE(JSON_EXTRACT(rule_json, '$.agency'), JSON_OBJECT())
|
|
||||||
),
|
|
||||||
'$.host.point_ratio_percent', 100,
|
|
||||||
'$.host.use_gift_type_ratio', JSON_EXTRACT('true', '$'),
|
|
||||||
'$.agency.point_ratio_percent', 20,
|
|
||||||
'$.agency.share_base', 'host_income'
|
|
||||||
),
|
|
||||||
'Fami 主播 POINT 收益政策;Agency 按主播实际 POINT 收益由平台额外发放 20%,以发布后的运行快照为准。',
|
|
||||||
0, 0, @now_ms, @now_ms
|
0, 0, @now_ms, @now_ms
|
||||||
FROM admin_policy_templates
|
FROM admin_policy_templates
|
||||||
WHERE template_code = 'first_google70000_coin_seller_92000_100000_v1' AND template_version = 'v1'
|
WHERE template_code = 'first_google70000_coin_seller_92000_100000_v1' AND template_version = 'v1'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user