diff --git a/src/dao/yibao_merchant_dao.go b/src/dao/yibao_merchant_dao.go index d3b83ce..7964431 100644 --- a/src/dao/yibao_merchant_dao.go +++ b/src/dao/yibao_merchant_dao.go @@ -5,4 +5,6 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" type YibaoMerchantDao interface { GetYibaoMerchant(merchantNo string) (m *models.YibaoMerchant, err error) GetYibaoMerchantById(id string) (m *models.YibaoMerchant, err error) + GetYibaoMerchantByStore(platform, types, storeId string) (m *models.YibaoMerchant, err error) + GetYibaoMerchantReqNo(reqNo string) (m *models.YibaoMerchant, err error) } diff --git a/src/implement/yibao_merchant_db.go b/src/implement/yibao_merchant_db.go index 7c7dabf..bfcacf2 100644 --- a/src/implement/yibao_merchant_db.go +++ b/src/implement/yibao_merchant_db.go @@ -25,6 +25,17 @@ func (y YibaoMerchantDb) GetYibaoMerchant(merchantNo string) (m *models.YibaoMer } return m, nil } +func (y YibaoMerchantDb) GetYibaoMerchantReqNo(reqNo string) (m *models.YibaoMerchant, err error) { + m = new(models.YibaoMerchant) + has, err := y.Db.Where("request_no = ?", reqNo).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} func (y YibaoMerchantDb) GetYibaoMerchantById(id string) (m *models.YibaoMerchant, err error) { m = new(models.YibaoMerchant) has, err := y.Db.Where("id = ?", id).Get(m) @@ -36,3 +47,14 @@ func (y YibaoMerchantDb) GetYibaoMerchantById(id string) (m *models.YibaoMerchan } return m, nil } +func (y YibaoMerchantDb) GetYibaoMerchantByStore(platform, types, storeId string) (m *models.YibaoMerchant, err error) { + m = new(models.YibaoMerchant) + has, err := y.Db.Where("platform = ? and type=? and store_id=?", platform, types, storeId).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +}