diff --git a/soul-api/internal/handler/ckb.go b/soul-api/internal/handler/ckb.go index 2fff6778..773533c8 100644 --- a/soul-api/internal/handler/ckb.go +++ b/soul-api/internal/handler/ckb.go @@ -163,6 +163,22 @@ func CKBJoin(c *gin.Context) { database.DB().Model(&model.User{}).Where("id = ?", body.UserID).Updates(updates) } } + // 同时写入 match_records 表,让后台「找伙伴」各 Tab 能看到 + if body.UserID != "" { + rec := model.MatchRecord{ + ID: fmt.Sprintf("mr_ckb_%d", time.Now().UnixNano()), + UserID: body.UserID, + MatchType: body.Type, + } + if body.Phone != "" { + rec.Phone = &body.Phone + } + if body.Wechat != "" { + rec.WechatID = &body.Wechat + } + database.DB().Create(&rec) + } + msg := "成功加入" + ckbSourceMap[body.Type] if result.Message == "已存在" { msg = "您已加入,我们会尽快联系您"