|
|
@@ -0,0 +1,38 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
type YibaoMerchantDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func NewYibaoMerchantDb(engine *xorm.Engine) dao.YibaoMerchantDao { |
|
|
|
return &YibaoMerchantDb{Db: engine} |
|
|
|
} |
|
|
|
func (y YibaoMerchantDb) GetYibaoMerchant(merchantNo string) (m *models.YibaoMerchant, err error) { |
|
|
|
m = new(models.YibaoMerchant) |
|
|
|
has, err := y.Db.Where("merchant_no = ?", merchantNo).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) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |