|
|
@ -11,6 +11,11 @@ import ( |
|
|
|
func (c *ControllerV1) GetChannel(ctx context.Context, req *v1.GetChannelReq) (res *v1.GetChannelRes, err error) { |
|
|
|
res = &v1.GetChannelRes{} |
|
|
|
err = dao.GoChannels.Ctx(ctx).WherePri(req.Id).Scan(&res.GoChannels) |
|
|
|
err = dao.GoShows.Ctx(ctx).With(entity.GoUsers{}).Where("channel_id =?", req.Id).Scan(&res.List) |
|
|
|
query := dao.GoShows.Ctx(ctx).With(entity.GoUsers{}).Where("channel_id =?", req.Id) |
|
|
|
if req.FlagType != 0 { |
|
|
|
query = query.Where("flag_type =?", req.FlagType) |
|
|
|
} |
|
|
|
err = query.Scan(&res.List) |
|
|
|
res.Status, err = dao.GoChannelSubscriptions.Ctx(ctx).Wheref("channel_id =? and user_id =?", req.Id, req.UserId).Exist() |
|
|
|
return |
|
|
|
} |