fix: preserve legacy channel parent names

This commit is contained in:
Yvan
2026-11-06 22:04:42 +08:00
parent 9fccd804a3
commit 870c83efea
3 changed files with 10 additions and 9 deletions
+9 -2
View File
@@ -126,10 +126,17 @@ func TestChannelHTTPListsMetricsOptionsAndAtomicCreation(t *testing.T) {
t.Fatal("主渠道不见了")
return nil
}
row := rootRow(list(8, "", 2))
if row["gameCount"] != float64(1) || row["playerCount"] != float64(1) || row["totalPayAmount"] != "30.30" || row["busierDisplayName"] != "sdk-account(leaf)" {
firstPage := list(8, "", 2)
row := rootRow(firstPage)
if row["gameCount"] != float64(1) || row["playerCount"] != float64(1) || row["totalPayAmount"] != "30.30" || row["busierDisplayName"] != "sdk-account(leaf)" || row["parentName"] != "" {
t.Fatalf("默认偏好或展示字段错误: %+v", row)
}
for _, raw := range firstPage["rows"].([]any) {
child := raw.(map[string]any)
if child["id"] == "101" && child["parentName"] != "main-channel" {
t.Fatalf("父级名称应保留渠道原始值: %+v", child)
}
}
if err := db.Exec("INSERT INTO sys_user_preference(user_id,include_sub_promote,idcard_dedup) VALUES(8,1,0)").Error; err != nil {
t.Fatal(err)
}