## 1. 修复店铺创建逻辑 - [x] 1.1 在 `internal/service/shop/service.go` 的 `Create` 方法中,找到 `account := &model.Account{...}` 的赋值块,添加 `IsPrimary: true` 字段 - [x] 1.2 运行 `lsp_diagnostics` 确认 `shop/service.go` 无错误 ## 2. 数据库迁移(历史数据修复) - [x] 2.1 在 `migrations/` 目录创建迁移文件,包含以下 UP SQL:对每个 shop 取 `created_at` 最早的代理账号(`user_type = 3, deleted_at IS NULL`)执行 `UPDATE tb_account SET is_primary = true WHERE id = AND is_primary = false` - [x] 2.2 执行迁移,使用 PostgreSQL MCP 验证:查询 `SELECT shop_id, COUNT(*) as primary_count FROM tb_account WHERE is_primary = true AND deleted_at IS NULL GROUP BY shop_id`,确认每个 shop 有且仅有一条 `is_primary = true` 的账号 ## 3. 接口验证 - [x] 3.1 使用 PostgreSQL MCP 验证:`SELECT username, phone FROM tb_account WHERE is_primary = true AND deleted_at IS NULL`,确认用户名和手机号均非空 - [x] 3.2 调用 `GET /api/admin/shops/fund-summary?page=1&page_size=20`,验证响应中每条记录的 `username` 和 `phone` 字段均返回正确值(非空)