From 4540786aa5657ca74da608f492b4a6d4ca38f050 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 19 Jun 2024 19:19:13 +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/implement/installment_payment_list_db.go | 5 +++-- src/implement/installment_payment_repaid_flow_db.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/implement/installment_payment_list_db.go b/src/implement/installment_payment_list_db.go index 8826078..659a224 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -53,15 +53,16 @@ func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *mode 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"]) if arg["state"] != "" { sess.And("is_repaid_off=?", zhios_order_relate_utils.StrToInt(arg["state"])-1) } size := zhios_order_relate_utils.StrToInt(arg["size"]) start := (zhios_order_relate_utils.StrToInt(arg["p"]) - 1) * size - err = sess.Limit(size, start).Find(m) + err = sess.Limit(size, start).Find(&mm) if err != nil { return nil, zhios_order_relate_logx.Error(err) } - return m, nil + return &mm, nil } diff --git a/src/implement/installment_payment_repaid_flow_db.go b/src/implement/installment_payment_repaid_flow_db.go index d9b1376..d713076 100644 --- a/src/implement/installment_payment_repaid_flow_db.go +++ b/src/implement/installment_payment_repaid_flow_db.go @@ -24,12 +24,13 @@ func (i InstallmentPaymentRepaidFlowDb) InsertInstallmentPaymentRepaidFlowBySess return m.Id, nil } func (i InstallmentPaymentRepaidFlowDb) FinInstallmentRepaidFlow(arg map[string]string) (m *[]models.InstallmentPaymentRepaidFlow, err error) { + mm := make([]models.InstallmentPaymentRepaidFlow, 0) sess := i.Db.Where("uid=?", arg["uid"]).And("record_id=?", arg["id"]) size := zhios_order_relate_utils.StrToInt(arg["size"]) start := (zhios_order_relate_utils.StrToInt(arg["p"]) - 1) * size - err = sess.Limit(size, start).Find(m) + err = sess.Limit(size, start).Find(&mm) if err != nil { return nil, zhios_order_relate_logx.Error(err) } - return m, nil + return &mm, nil }