From 4be9e912bddac39dc6042bb26cc1ca34ac484bae Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 16:01:34 +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_list_dao.go | 2 ++ src/implement/installment_payment_list_db.go | 22 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/dao/installment_payment_list_dao.go b/src/dao/installment_payment_list_dao.go index 18981d7..0b6c6ef 100644 --- a/src/dao/installment_payment_list_dao.go +++ b/src/dao/installment_payment_list_dao.go @@ -8,6 +8,8 @@ import ( type InstallmentPaymentListDao interface { GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) GetInstallmentPaymentListByIdSess(sess *xorm.Session, oid string) (m *models.InstallmentPaymentList, err error) + GetInstallmentPaymentListByOidSess(sess *xorm.Session, oid string) (m *models.InstallmentPaymentList, err error) + GetInstallmentPaymentListByOid(oid string) (m *models.InstallmentPaymentList, err error) FinInstallmentPaymentList(arg map[string]string) (m *[]models.InstallmentPaymentList, err error) UpdateInstallmentPaymentListBySess(sess *xorm.Session, m *models.InstallmentPaymentList, forceColums ...string) (int64, error) InsertInstallmentPaymentList(m *models.InstallmentPaymentList) (id int, err error) diff --git a/src/implement/installment_payment_list_db.go b/src/implement/installment_payment_list_db.go index 26246a2..fc56c42 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -40,6 +40,17 @@ func (i InstallmentPaymentListDb) UpdateInstallmentPaymentListBySess(sess *xorm. } return affected, nil } +func (i InstallmentPaymentListDb) GetInstallmentPaymentListByOid(id string) (m *models.InstallmentPaymentList, err error) { + m = new(models.InstallmentPaymentList) + has, err := i.Db.Where("ord_id =?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) { m = new(models.InstallmentPaymentList) @@ -63,6 +74,17 @@ func (i InstallmentPaymentListDb) GetInstallmentPaymentListByIdSess(sess *xorm.S } return m, nil } +func (i InstallmentPaymentListDb) GetInstallmentPaymentListByOidSess(sess *xorm.Session, id string) (m *models.InstallmentPaymentList, err error) { + m = new(models.InstallmentPaymentList) + has, err := sess.Where("ord_id =?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} func (i InstallmentPaymentListDb) FinInstallmentPaymentList(arg map[string]string) (m *[]models.InstallmentPaymentList, err error) { mm := make([]models.InstallmentPaymentList, 0) sess := i.Db.Where("uid=?", arg["uid"])