数据关联手机号查询

This commit is contained in:
2026-03-20 14:37:41 +08:00
parent bb895eccdf
commit 71f1c6f141
10 changed files with 417 additions and 8 deletions

View File

@@ -29,7 +29,14 @@ func PageChannelsByAdmin(c *fiber.Ctx) error {
}
// 查询通道列表
list, total, err := q.Channel.FindByPage(req.GetOffset(), req.GetLimit())
list, total, err := q.Channel.
Joins(q.Channel.User).
Select(
q.Channel.ALL,
q.User.As("User").Phone.As("User__phone"),
q.User.As("User").Name.As("User__name"),
).
FindByPage(req.GetOffset(), req.GetLimit())
if err != nil {
return err
}