Browse Source

更新

master
huangjiajun 1 month ago
parent
commit
11a65c8c41
2 changed files with 24 additions and 0 deletions
  1. +2
    -0
      src/dao/yibao_merchant_dao.go
  2. +22
    -0
      src/implement/yibao_merchant_db.go

+ 2
- 0
src/dao/yibao_merchant_dao.go View File

@@ -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)
}

+ 22
- 0
src/implement/yibao_merchant_db.go View File

@@ -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
}

Loading…
Cancel
Save