db fail
This commit is contained in:
parent
240cd23fb6
commit
70dbaf72c0
|
|
@ -35,14 +35,14 @@ func (s OrderNotifyEvent) IsUsed() bool {
|
|||
return s == OrderNotifyEventUsed
|
||||
}
|
||||
|
||||
func (s OrderNotifyEvent) CanNotify() bool {
|
||||
return s.IsSendDEd() || s.IsUsed()
|
||||
}
|
||||
|
||||
func (s OrderNotifyEvent) IsExpired() bool {
|
||||
return s == OrderNotifyEventExpired
|
||||
}
|
||||
|
||||
func (s OrderNotifyEvent) CanNotify() bool {
|
||||
return s.IsSendDEd() || s.IsUsed() || s.IsExpired()
|
||||
}
|
||||
|
||||
var OrderNotifyEventMapCmbStatus = map[OrderNotifyEvent]CmbStatus{
|
||||
OrderNotifyEventSendDEd: CmbStatusSuccess,
|
||||
OrderNotifyEventUsed: CmbStatusUse,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ func NewOrderRepoImpl(db *data.Db) repo.OrderRepo {
|
|||
}
|
||||
|
||||
func (p *OrderRepoImpl) DB(ctx context.Context) *gorm.DB {
|
||||
return p.db.DB(ctx).Model(model.Order{})
|
||||
return p.db.DB(ctx).WithContext(ctx).Model(model.Order{})
|
||||
}
|
||||
|
||||
func (p *OrderRepoImpl) FindInBatches(ctx context.Context, w *bo.FindInBatchesUseBo, fun func(ctx context.Context, rows []*bo.OrderBo) error) error {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func NewOrderNotifyRepoImpl(db *data.Db) repo.OrderNotifyRepo {
|
|||
}
|
||||
|
||||
func (p *OrderNotifyRepoImpl) DB(ctx context.Context) *gorm.DB {
|
||||
return p.db.DB(ctx).Model(model.OrderNotify{})
|
||||
return p.db.DB(ctx).WithContext(ctx).Model(model.OrderNotify{})
|
||||
}
|
||||
|
||||
func (p *OrderNotifyRepoImpl) GetByID(ctx context.Context, id uint64) (*bo.OrderNotifyBo, error) {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ func NewProductRepoImpl(db *data.Db) repo.ProductRepo {
|
|||
}
|
||||
|
||||
func (p *ProductRepoImpl) DB(ctx context.Context) *gorm.DB {
|
||||
return p.db.DB(ctx).Model(model.Product{})
|
||||
return p.db.DB(ctx).WithContext(ctx).Model(model.Product{})
|
||||
}
|
||||
|
||||
func (r *ProductRepoImpl) GetByPNO(ctx context.Context, PNO string) (*bo.ProductBo, error) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func NewWechatNotifyRegisterTagRepoImpl(db *data.Db) repo.WechatNotifyRegisterTa
|
|||
}
|
||||
|
||||
func (p *WechatNotifyRegisterTagRepoImpl) DB(ctx context.Context) *gorm.DB {
|
||||
return p.db.DB(ctx).Model(model.WechatNotifyRegisterTag{})
|
||||
return p.db.DB(ctx).WithContext(ctx).Model(model.WechatNotifyRegisterTag{})
|
||||
}
|
||||
|
||||
func (p *WechatNotifyRegisterTagRepoImpl) GetByStockIdAndMchId(ctx context.Context, stockCreatorMchID, stockId string) (*bo.WechatNotifyRegisterTagBo, error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue