This commit is contained in:
李子铭 2025-03-20 15:48:14 +08:00
parent d1b0380c4d
commit 3eb170f4bd
3 changed files with 14 additions and 14 deletions

View File

@ -33,7 +33,7 @@ func (p *OrderRepoImpl) FindInBatches(ctx context.Context, w *bo.FindInBatchesUs
var results = make([]*model.Order, 0) var results = make([]*model.Order, 0)
result := p.db.DB(ctx). result := p.DB(ctx).
Where("type = ?", w.Type). Where("type = ?", w.Type).
Where("status IN (?)", []uint8{vo.OrderStatusSuccess.GetValue(), vo.OrderStatusUse.GetValue()}). Where("status IN (?)", []uint8{vo.OrderStatusSuccess.GetValue(), vo.OrderStatusUse.GetValue()}).
Where("receive_success_time BETWEEN ? AND ?", w.StartTime, w.EndTime). Where("receive_success_time BETWEEN ? AND ?", w.StartTime, w.EndTime).
@ -73,7 +73,7 @@ func (p *OrderRepoImpl) Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderB
UpdateTime: &now, UpdateTime: &now,
} }
tx := p.db.DB(ctx).Create(info) tx := p.DB(ctx).Create(info)
if tx.Error != nil { if tx.Error != nil {
return nil, fmt.Errorf("create db fail %w", tx.Error) return nil, fmt.Errorf("create db fail %w", tx.Error)
} }
@ -148,7 +148,7 @@ func (p *OrderRepoImpl) GetByMBV(ctx context.Context, merchantNo, batchNo, vouch
func (p *OrderRepoImpl) Ing(ctx context.Context, id uint64) error { func (p *OrderRepoImpl) Ing(ctx context.Context, id uint64) error {
now := time.Now() now := time.Now()
tx := p.db.DB(ctx). tx := p.DB(ctx).
Where(model.Order{ Where(model.Order{
ID: id, ID: id,
Status: vo.OrderStatusWait.GetValue(), Status: vo.OrderStatusWait.GetValue(),
@ -168,7 +168,7 @@ func (p *OrderRepoImpl) Ing(ctx context.Context, id uint64) error {
func (p *OrderRepoImpl) Success(ctx context.Context, id uint64, voucherNo string) error { func (p *OrderRepoImpl) Success(ctx context.Context, id uint64, voucherNo string) error {
now := time.Now() now := time.Now()
tx := p.db.DB(ctx). tx := p.DB(ctx).
Where(model.Order{ Where(model.Order{
ID: id, ID: id,
Status: vo.OrderStatusIng.GetValue(), Status: vo.OrderStatusIng.GetValue(),
@ -190,7 +190,7 @@ func (p *OrderRepoImpl) Success(ctx context.Context, id uint64, voucherNo string
func (p *OrderRepoImpl) Available(ctx context.Context, id uint64) error { func (p *OrderRepoImpl) Available(ctx context.Context, id uint64) error {
now := time.Now() now := time.Now()
tx := p.db.DB(ctx). tx := p.DB(ctx).
Where(model.Order{ Where(model.Order{
ID: id, ID: id,
Status: vo.OrderStatusUse.GetValue(), Status: vo.OrderStatusUse.GetValue(),
@ -218,7 +218,7 @@ func (p *OrderRepoImpl) Fail(ctx context.Context, id uint64, remark string) erro
} }
} }
tx := p.db.DB(ctx). tx := p.DB(ctx).
Where(model.Order{ Where(model.Order{
ID: id, ID: id,
}). }).
@ -238,7 +238,7 @@ func (p *OrderRepoImpl) Fail(ctx context.Context, id uint64, remark string) erro
func (p *OrderRepoImpl) Used(ctx context.Context, id uint64) error { func (p *OrderRepoImpl) Used(ctx context.Context, id uint64) error {
now := time.Now() now := time.Now()
tx := p.db.DB(ctx). tx := p.DB(ctx).
Where(model.Order{ Where(model.Order{
ID: id, ID: id,
}). }).
@ -258,7 +258,7 @@ func (p *OrderRepoImpl) Used(ctx context.Context, id uint64) error {
func (p *OrderRepoImpl) Expired(ctx context.Context, id uint64) error { func (p *OrderRepoImpl) Expired(ctx context.Context, id uint64) error {
now := time.Now() now := time.Now()
tx := p.db.DB(ctx). tx := p.DB(ctx).
Where(model.Order{ Where(model.Order{
ID: id, ID: id,
}). }).

View File

@ -71,7 +71,7 @@ func (p *OrderNotifyRepoImpl) Create(ctx context.Context, req *bo.OrderNotifyBo)
UpdateTime: &now, UpdateTime: &now,
} }
if err := p.db.DB(ctx).Create(info).Error; err != nil { if err := p.DB(ctx).Create(info).Error; err != nil {
return nil, err return nil, err
} }
@ -81,7 +81,7 @@ func (p *OrderNotifyRepoImpl) Create(ctx context.Context, req *bo.OrderNotifyBo)
func (p *OrderNotifyRepoImpl) Success(ctx context.Context, id uint64, responses string) error { func (p *OrderNotifyRepoImpl) Success(ctx context.Context, id uint64, responses string) error {
now := time.Now() now := time.Now()
res := p.db.DB(ctx). res := p.DB(ctx).
Where(model.OrderNotify{ Where(model.OrderNotify{
ID: id, ID: id,
Status: vo.OrderNotifyStatusWait.GetValue(), Status: vo.OrderNotifyStatusWait.GetValue(),
@ -110,7 +110,7 @@ func (p *OrderNotifyRepoImpl) Fail(ctx context.Context, id uint64, remark string
now := time.Now() now := time.Now()
res := p.db.DB(ctx). res := p.DB(ctx).
Where(model.OrderNotify{ Where(model.OrderNotify{
ID: id, ID: id,
Status: vo.OrderNotifyStatusWait.GetValue(), Status: vo.OrderNotifyStatusWait.GetValue(),

View File

@ -55,7 +55,7 @@ func (p *WechatNotifyRegisterTagRepoImpl) Create(ctx context.Context, req *bo.We
CreateTime: &now, CreateTime: &now,
} }
if err := p.db.DB(ctx).Create(info).Error; err != nil { if err := p.DB(ctx).Create(info).Error; err != nil {
return nil, err return nil, err
} }
@ -65,7 +65,7 @@ func (p *WechatNotifyRegisterTagRepoImpl) Create(ctx context.Context, req *bo.We
func (p *WechatNotifyRegisterTagRepoImpl) Success(ctx context.Context, id int32) error { func (p *WechatNotifyRegisterTagRepoImpl) Success(ctx context.Context, id int32) error {
now := time.Now() now := time.Now()
res := p.db.DB(ctx). res := p.DB(ctx).
Where(model.WechatNotifyRegisterTag{ Where(model.WechatNotifyRegisterTag{
ID: id, ID: id,
Status: vo.WechatNotifyRegisterTagStatusWait.GetValue(), Status: vo.WechatNotifyRegisterTagStatusWait.GetValue(),
@ -93,7 +93,7 @@ func (p *WechatNotifyRegisterTagRepoImpl) Fail(ctx context.Context, id int32, re
now := time.Now() now := time.Now()
res := p.db.DB(ctx). res := p.DB(ctx).
Where(model.WechatNotifyRegisterTag{ Where(model.WechatNotifyRegisterTag{
ID: id, ID: id,
Status: vo.WechatNotifyRegisterTagStatusWait.GetValue(), Status: vo.WechatNotifyRegisterTagStatusWait.GetValue(),