浏览代码

更新

master
huangjiajun 1周前
父节点
当前提交
11a65c8c41
共有 2 个文件被更改,包括 24 次插入0 次删除
  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 查看文件

@@ -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 查看文件

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

正在加载...
取消
保存