Some checks failed
Build docker and publish / linux (1.24.5) (push) Failing after 40s
feat(pay): 添加支付API基础结构 feat(miniapp): 创建支付测试小程序页面与配置 feat(wechatpay): 配置微信支付参数与证书 fix(guild): 修复成员列表查询条件 docs: 更新代码规范文档与需求文档 style: 统一前后端枚举显示与注释格式 refactor(admin): 重构用户奖励发放接口参数处理 test(title): 添加称号效果参数验证测试
33 lines
996 B
Go
33 lines
996 B
Go
package activity
|
|
|
|
import (
|
|
"context"
|
|
|
|
"bindbox-game/internal/repository/mysql/model"
|
|
)
|
|
|
|
// GetDrawReceipt 通过抽奖ID查询抽奖收据
|
|
// 入参: drawID 抽奖ID
|
|
// 返回: 收据记录与错误信息
|
|
func (s *service) GetDrawReceipt(ctx context.Context, drawID int64) (*model.ActivityDrawReceipts, error) {
|
|
rec, err := s.readDB.ActivityDrawReceipts.WithContext(ctx).
|
|
Where(s.readDB.ActivityDrawReceipts.DrawID.Eq(drawID)).
|
|
First()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return rec, nil
|
|
}
|
|
|
|
// GetDrawReceiptByLogID 通过日志ID查询抽奖收据
|
|
// 入参: logID 抽奖日志ID
|
|
// 返回: 收据记录与错误信息
|
|
func (s *service) GetDrawReceiptByLogID(ctx context.Context, logID int64) (*model.ActivityDrawReceipts, error) {
|
|
rec, err := s.readDB.ActivityDrawReceipts.WithContext(ctx).
|
|
Where(s.readDB.ActivityDrawReceipts.DrawLogID.Eq(logID)).
|
|
First()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return rec, nil
|
|
} |