发券,过期发券验证
This commit is contained in:
parent
a17ead31f1
commit
3ac5a26048
|
|
@ -2,6 +2,7 @@ package repoimpl
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
|
@ -34,6 +35,9 @@ func (p *OrderNotifyRepoImpl) GetByID(ctx context.Context, id uint64) (*bo.Order
|
|||
tx := p.DB(ctx).Where(model.OrderNotify{ID: id}).First(&info)
|
||||
|
||||
if tx.Error != nil {
|
||||
if errors.Is(tx.Error, gorm.ErrRecordNotFound) {
|
||||
return nil, err2.ErrorDbNotFound("orderNotify数据不存在")
|
||||
}
|
||||
return nil, tx.Error
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ func (r *ProductRepoImpl) getByProductNo(ctx context.Context, item *model.Produc
|
|||
if errors.Is(tx.Error, gorm.ErrRecordNotFound) {
|
||||
return nil, err2.ErrorDbNotFound("商品数据不存在")
|
||||
}
|
||||
|
||||
sqlDB, _ := db.DB()
|
||||
log.Warnf("product当前打开连接数:%d,空闲连接数:%d", sqlDB.Stats().OpenConnections, sqlDB.Stats().Idle)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package repoimpl
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
|
@ -34,6 +35,9 @@ func (p *WechatNotifyRegisterTagRepoImpl) GetByStockIdAndMchId(ctx context.Conte
|
|||
tx := p.DB(ctx).Where(model.WechatNotifyRegisterTag{StockCreatorMchID: stockCreatorMchID, StockID: stockId}).First(&info)
|
||||
|
||||
if tx.Error != nil {
|
||||
if errors.Is(tx.Error, gorm.ErrRecordNotFound) {
|
||||
return nil, err2.ErrorDbNotFound("notifyTag数据不存在")
|
||||
}
|
||||
return nil, tx.Error
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue