This commit is contained in:
李子铭 2025-03-11 16:59:40 +08:00
parent d3587c2c72
commit 61df9c223c
3 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ func (v *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo) (or
err = lock.NewMutex(v.rdb.Rdb, c.TTL).Lock(ctx, c.Key, func(ctx context.Context) error {
order, err := v.OrderRepo.GetByOutBizNo(ctx, vo.OrderTypeCmb, req.AppID, req.OutBizNo)
order, err := v.OrderRepo.GetByOutBizNo(ctx, vo.OrderTypeCmb, req.OutBizNo)
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
return err

View File

@ -7,7 +7,7 @@ import (
)
type OrderRepo interface {
GetByOutBizNo(ctx context.Context, t vo.OrderType, appId, outBizNo string) (*bo.OrderBo, error)
GetByOutBizNo(ctx context.Context, t vo.OrderType, outBizNo string) (*bo.OrderBo, error)
GetByOrderNo(ctx context.Context, orderNo string) (*bo.OrderBo, error)
Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderBo, error)
GetByID(ctx context.Context, id uint64) (*bo.OrderBo, error)

View File

@ -54,10 +54,10 @@ func (p *OrderRepoImpl) Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderB
return p.ToBo(info), nil
}
func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, t vo.OrderType, appId, outBizNo string) (*bo.OrderBo, error) {
func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, t vo.OrderType, outBizNo string) (*bo.OrderBo, error) {
info := &model.Order{}
tx := p.DB(ctx).Where(model.Order{Type: t.GetValue(), AppID: appId, OutBizNo: outBizNo}).Find(&info)
tx := p.DB(ctx).Where(model.Order{Type: t.GetValue(), OutBizNo: outBizNo}).Find(&info)
if tx.Error != nil {
return nil, tx.Error