Explorar el Código

更新

master
huangjiajun hace 1 semana
padre
commit
11a65c8c41
Se han modificado 2 ficheros con 24 adiciones y 0 borrados
  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 Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar