From 3172de4deb419f548b80d54817532acdc541d90f Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 11:13:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=9C=9F=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/installment_payment_scheme_with_goods_dao.go | 6 +++++- .../installment_payment_scheme_with_goods_db.go | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/dao/installment_payment_scheme_with_goods_dao.go b/src/dao/installment_payment_scheme_with_goods_dao.go index a00f121..3508d5d 100644 --- a/src/dao/installment_payment_scheme_with_goods_dao.go +++ b/src/dao/installment_payment_scheme_with_goods_dao.go @@ -1,7 +1,11 @@ package dao -import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + "xorm.io/xorm" +) type InstallmentPaymentSchemeWithGoodsDao interface { GetInstallmentPaymentSchemeGoodsByGoodsId(goodsId int) (m *models.InstallmentPaymentSchemeWithGoods, err error) + GetInstallmentPaymentSchemeGoodsByGoodsIdSess(sess *xorm.Session, goodsId int) (m *models.InstallmentPaymentSchemeWithGoods, err error) } diff --git a/src/implement/installment_payment_scheme_with_goods_db.go b/src/implement/installment_payment_scheme_with_goods_db.go index dc00bbb..1a7bf8c 100644 --- a/src/implement/installment_payment_scheme_with_goods_db.go +++ b/src/implement/installment_payment_scheme_with_goods_db.go @@ -25,3 +25,14 @@ func (i InstallmentPaymentSchemeWithGoodsDb) GetInstallmentPaymentSchemeGoodsByG } return m, nil } +func (i InstallmentPaymentSchemeWithGoodsDb) GetInstallmentPaymentSchemeGoodsByGoodsIdSess(sess *xorm.Session, goodsId int) (m *models.InstallmentPaymentSchemeWithGoods, err error) { + m = new(models.InstallmentPaymentSchemeWithGoods) + has, err := sess.Where("goods_id =?", goodsId).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +}