From f8e29b52828ad490e6bb9c8afbe6f3e3d7058d65 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 19 Jun 2024 19:08:12 +0800 Subject: [PATCH 01/12] =?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 | 3 ++- src/dao/installment_payment_repaid_flow_dao.go | 3 ++- src/implement/installment_payment_list_db.go | 16 +++++++++++++++- .../installment_payment_repaid_flow_db.go | 14 +++++++++++++- src/models/installment_payment_list.go | 2 ++ 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/dao/installment_payment_list_dao.go b/src/dao/installment_payment_list_dao.go index 175ada5..15a21ed 100644 --- a/src/dao/installment_payment_list_dao.go +++ b/src/dao/installment_payment_list_dao.go @@ -1,4 +1,4 @@ -package dao +package dao import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" @@ -7,6 +7,7 @@ import ( type InstallmentPaymentListDao interface { GetInstallmentPaymentListById(id int) (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/dao/installment_payment_repaid_flow_dao.go b/src/dao/installment_payment_repaid_flow_dao.go index 4a0930d..f1267cd 100644 --- a/src/dao/installment_payment_repaid_flow_dao.go +++ b/src/dao/installment_payment_repaid_flow_dao.go @@ -1,4 +1,4 @@ -package dao +package dao import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" @@ -7,4 +7,5 @@ import ( type InstallmentPaymentRepaidFlowDao interface { InsertInstallmentPaymentRepaidFlowBySession(session *xorm.Session, m *models.InstallmentPaymentRepaidFlow) (id int, err error) + FinInstallmentRepaidFlow(arg map[string]string) (m *[]models.InstallmentPaymentRepaidFlow, err error) } diff --git a/src/implement/installment_payment_list_db.go b/src/implement/installment_payment_list_db.go index b2e4bf9..8826078 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -1,8 +1,9 @@ -package implement +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_utils "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils" zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -51,3 +52,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) { + 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) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return m, nil +} diff --git a/src/implement/installment_payment_repaid_flow_db.go b/src/implement/installment_payment_repaid_flow_db.go index 538f839..d9b1376 100644 --- a/src/implement/installment_payment_repaid_flow_db.go +++ b/src/implement/installment_payment_repaid_flow_db.go @@ -1,8 +1,10 @@ -package implement +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_utils "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils" + zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -21,3 +23,13 @@ func (i InstallmentPaymentRepaidFlowDb) InsertInstallmentPaymentRepaidFlowBySess } return m.Id, nil } +func (i InstallmentPaymentRepaidFlowDb) FinInstallmentRepaidFlow(arg map[string]string) (m *[]models.InstallmentPaymentRepaidFlow, err error) { + 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) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return m, nil +} diff --git a/src/models/installment_payment_list.go b/src/models/installment_payment_list.go index de65be9..0487c27 100644 --- a/src/models/installment_payment_list.go +++ b/src/models/installment_payment_list.go @@ -9,6 +9,8 @@ type InstallmentPaymentList struct { InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` AlreadyRepaidInstallmentNums int `json:"already_repaid_installment_nums" xorm:"not null default 0 comment('已换分期数') TINYINT(3)"` RepaymentAmountPerInstallment string `json:"repayment_amount_per_installment" xorm:"not null default 0.00 comment('每期还款金额') DECIMAL(12,2)"` + GoodsTitle string `json:"goods_title" xorm:"not null default '' comment('标题') VARCHAR(255)"` + GoodsImg string `json:"goods_imgg" xorm:"not null default '' comment('图片') VARCHAR(255)"` IsRepaidOff int `json:"is_repaid_off" xorm:"not null default 0 comment('是否已偿还完(0:未偿还完 1:已偿还完)') TINYINT(1)"` CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` 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 02/12] =?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 } From 425c0278f4caff6f6a7e338d487eda01d0dd04b2 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 19 Jun 2024 19:32:23 +0800 Subject: [PATCH 03/12] =?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 | 2 +- src/implement/installment_payment_repaid_flow_db.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/implement/installment_payment_list_db.go b/src/implement/installment_payment_list_db.go index 659a224..aa2abf0 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -60,7 +60,7 @@ func (i InstallmentPaymentListDb) FinInstallmentPaymentList(arg map[string]strin } size := zhios_order_relate_utils.StrToInt(arg["size"]) start := (zhios_order_relate_utils.StrToInt(arg["p"]) - 1) * size - err = sess.Limit(size, start).Find(&mm) + err = sess.Limit(size, start).Desc("id").Find(&mm) if err != nil { return nil, zhios_order_relate_logx.Error(err) } diff --git a/src/implement/installment_payment_repaid_flow_db.go b/src/implement/installment_payment_repaid_flow_db.go index d713076..cd76b6f 100644 --- a/src/implement/installment_payment_repaid_flow_db.go +++ b/src/implement/installment_payment_repaid_flow_db.go @@ -3,7 +3,6 @@ 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_utils "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils" zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -26,9 +25,7 @@ func (i InstallmentPaymentRepaidFlowDb) InsertInstallmentPaymentRepaidFlowBySess 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(&mm) + err = sess.Find(&mm) if err != nil { return nil, zhios_order_relate_logx.Error(err) } From d29aad4d8336597cfb838259313021af4b6ffb2c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 11:01:52 +0800 Subject: [PATCH 04/12] =?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_dao.go | 3 ++- .../installment_payment_scheme_with_goods_dao.go | 6 ++++-- src/implement/installment_payment_scheme_db.go | 10 +++++++++- .../installment_payment_scheme_with_goods_db.go | 15 ++++++++++++++- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/dao/installment_payment_scheme_dao.go b/src/dao/installment_payment_scheme_dao.go index d81f5fb..935cb2c 100644 --- a/src/dao/installment_payment_scheme_dao.go +++ b/src/dao/installment_payment_scheme_dao.go @@ -1,8 +1,9 @@ -package dao +package dao import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" type InstallmentPaymentSchemeDao interface { InsertInstallmentPaymentScheme(m *models.InstallmentPaymentScheme) (id int, err error) GetInstallmentPaymentSchemeById(id int) (m *models.InstallmentPaymentScheme, err error) + FindInstallmentPaymentScheme() (m *[]models.InstallmentPaymentScheme, err error) } diff --git a/src/dao/installment_payment_scheme_with_goods_dao.go b/src/dao/installment_payment_scheme_with_goods_dao.go index 9d7faa3..a00f121 100644 --- a/src/dao/installment_payment_scheme_with_goods_dao.go +++ b/src/dao/installment_payment_scheme_with_goods_dao.go @@ -1,5 +1,7 @@ -package dao +package dao + +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" type InstallmentPaymentSchemeWithGoodsDao interface { - //TODO:: You can add specific method definitions here + GetInstallmentPaymentSchemeGoodsByGoodsId(goodsId int) (m *models.InstallmentPaymentSchemeWithGoods, err error) } diff --git a/src/implement/installment_payment_scheme_db.go b/src/implement/installment_payment_scheme_db.go index d7493f7..100415b 100644 --- a/src/implement/installment_payment_scheme_db.go +++ b/src/implement/installment_payment_scheme_db.go @@ -1,4 +1,4 @@ -package implement +package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" @@ -35,3 +35,11 @@ func (i InstallmentPaymentSchemeDb) GetInstallmentPaymentSchemeById(id int) (m * } return m, nil } +func (i InstallmentPaymentSchemeDb) FindInstallmentPaymentScheme() (m *[]models.InstallmentPaymentScheme, err error) { + mm := make([]models.InstallmentPaymentScheme, 0) + err = i.Db.Find(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &mm, nil +} diff --git a/src/implement/installment_payment_scheme_with_goods_db.go b/src/implement/installment_payment_scheme_with_goods_db.go index 6bd1965..dc00bbb 100644 --- a/src/implement/installment_payment_scheme_with_goods_db.go +++ b/src/implement/installment_payment_scheme_with_goods_db.go @@ -1,7 +1,9 @@ -package implement +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" ) @@ -12,3 +14,14 @@ type InstallmentPaymentSchemeWithGoodsDb struct { func NewInstallmentPaymentSchemeWithGoodsDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeWithGoodsDao { return &InstallmentPaymentSchemeWithGoodsDb{Db: engine} } +func (i InstallmentPaymentSchemeWithGoodsDb) GetInstallmentPaymentSchemeGoodsByGoodsId(goodsId int) (m *models.InstallmentPaymentSchemeWithGoods, err error) { + m = new(models.InstallmentPaymentSchemeWithGoods) + has, err := i.Db.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 +} 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 05/12] =?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 +} From 0dd2e759afe05190b8a907f28f4b63bc4fc4d397 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 13:44:33 +0800 Subject: [PATCH 06/12] =?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_scheme_db.go | 2 +- src/models/installment_payment_list.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/implement/installment_payment_scheme_db.go b/src/implement/installment_payment_scheme_db.go index 100415b..46c9724 100644 --- a/src/implement/installment_payment_scheme_db.go +++ b/src/implement/installment_payment_scheme_db.go @@ -37,7 +37,7 @@ func (i InstallmentPaymentSchemeDb) GetInstallmentPaymentSchemeById(id int) (m * } func (i InstallmentPaymentSchemeDb) FindInstallmentPaymentScheme() (m *[]models.InstallmentPaymentScheme, err error) { mm := make([]models.InstallmentPaymentScheme, 0) - err = i.Db.Find(m) + err = i.Db.Find(mm) if err != nil { return nil, zhios_order_relate_logx.Error(err) } diff --git a/src/models/installment_payment_list.go b/src/models/installment_payment_list.go index 0487c27..434be1e 100644 --- a/src/models/installment_payment_list.go +++ b/src/models/installment_payment_list.go @@ -6,6 +6,7 @@ type InstallmentPaymentList struct { GoodsId int `json:"goods_id" xorm:"not null default 0 comment('商品ID') INT(11)"` OrdId int64 `json:"ord_id" xorm:"not null default 0 comment('订单ID') BIGINT(20)"` TotalAmount string `json:"total_amount" xorm:"not null default 0.00 comment('总金额') DECIMAL(12,2)"` + Commission string `json:"commission" xorm:"not null default 0.00 comment('总金额') DECIMAL(12,2)"` InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` AlreadyRepaidInstallmentNums int `json:"already_repaid_installment_nums" xorm:"not null default 0 comment('已换分期数') TINYINT(3)"` RepaymentAmountPerInstallment string `json:"repayment_amount_per_installment" xorm:"not null default 0.00 comment('每期还款金额') DECIMAL(12,2)"` From 0a6054ba551ec01f6f8a1e007d15bb124fcfb13d Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 13:49:28 +0800 Subject: [PATCH 07/12] =?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_scheme_db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/implement/installment_payment_scheme_db.go b/src/implement/installment_payment_scheme_db.go index 46c9724..d2290ac 100644 --- a/src/implement/installment_payment_scheme_db.go +++ b/src/implement/installment_payment_scheme_db.go @@ -37,7 +37,7 @@ func (i InstallmentPaymentSchemeDb) GetInstallmentPaymentSchemeById(id int) (m * } func (i InstallmentPaymentSchemeDb) FindInstallmentPaymentScheme() (m *[]models.InstallmentPaymentScheme, err error) { mm := make([]models.InstallmentPaymentScheme, 0) - err = i.Db.Find(mm) + err = i.Db.Where("1=1").Find(&mm) if err != nil { return nil, zhios_order_relate_logx.Error(err) } From 7681773b89306be31d8650388ddb29b75336c966 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 15:42:14 +0800 Subject: [PATCH 08/12] =?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 | 1 + src/implement/installment_payment_list_db.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/dao/installment_payment_list_dao.go b/src/dao/installment_payment_list_dao.go index 15a21ed..87a9482 100644 --- a/src/dao/installment_payment_list_dao.go +++ b/src/dao/installment_payment_list_dao.go @@ -7,6 +7,7 @@ import ( type InstallmentPaymentListDao interface { GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) + GetInstallmentPaymentListByOidSess(sess *xorm.Session, 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 aa2abf0..b71a651 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -52,6 +52,17 @@ func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *mode } return m, nil } +func (i InstallmentPaymentListDb) GetInstallmentPaymentListByOidSess(sess *xorm.Session, oid string) (m *models.InstallmentPaymentList, err error) { + m = new(models.InstallmentPaymentList) + has, err := sess.Where("ord_id =?", oid).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"]) From d8b7622ed9f491e07beb9eb95bf793efe16db523 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 15:47:09 +0800 Subject: [PATCH 09/12] =?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 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dao/installment_payment_list_dao.go b/src/dao/installment_payment_list_dao.go index 87a9482..18981d7 100644 --- a/src/dao/installment_payment_list_dao.go +++ b/src/dao/installment_payment_list_dao.go @@ -7,7 +7,7 @@ import ( type InstallmentPaymentListDao interface { GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) - GetInstallmentPaymentListByOidSess(sess *xorm.Session, oid string) (m *models.InstallmentPaymentList, err error) + GetInstallmentPaymentListByIdSess(sess *xorm.Session, 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 b71a651..26246a2 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -52,9 +52,9 @@ func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *mode } return m, nil } -func (i InstallmentPaymentListDb) GetInstallmentPaymentListByOidSess(sess *xorm.Session, oid string) (m *models.InstallmentPaymentList, err error) { +func (i InstallmentPaymentListDb) GetInstallmentPaymentListByIdSess(sess *xorm.Session, id string) (m *models.InstallmentPaymentList, err error) { m = new(models.InstallmentPaymentList) - has, err := sess.Where("ord_id =?", oid).Get(m) + has, err := sess.Where("id =?", id).Get(m) if err != nil { return nil, zhios_order_relate_logx.Error(err) } 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 10/12] =?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"]) From 9ebf54e21441faebd10c7596fa7268eb5860e499 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 20 Jun 2024 18:04:00 +0800 Subject: [PATCH 11/12] =?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/models/installment_payment_repaid_flow.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/installment_payment_repaid_flow.go b/src/models/installment_payment_repaid_flow.go index 8e374d1..1cd848a 100644 --- a/src/models/installment_payment_repaid_flow.go +++ b/src/models/installment_payment_repaid_flow.go @@ -8,4 +8,5 @@ type InstallmentPaymentRepaidFlow struct { WhichRepaymentPeriod int `json:"which_repayment_period" xorm:"not null default 1 comment('第x还款') TINYINT(3)"` CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` + OrdId int64 `json:"ord_id" xorm:"not null default 0 comment('订单ID') BIGINT(20)"` } From e1cc279702d9c9a254a7cbb908252103f29da902 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 22 Jun 2024 16:01:55 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=9E=9C=E5=9B=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/happy_orchard_basic_setting.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/models/happy_orchard_basic_setting.go b/src/models/happy_orchard_basic_setting.go index b24db8e..fa24b8a 100644 --- a/src/models/happy_orchard_basic_setting.go +++ b/src/models/happy_orchard_basic_setting.go @@ -33,4 +33,6 @@ type HappyOrchardBasicSetting struct { VirtualRewardIsAutoSend int `json:"virtual_reward_is_auto_send" xorm:"not null default 0 comment('虚拟奖品是否自动发放(1:是 2:否)') TINYINT(1)"` CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` + SignAdvId int `json:"sign_adv_id" xorm:"not null default 0 comment('签到看的广告ID') TINYINT(1)"` + IsCanMultiple int `json:"is_can_multiple" xorm:"not null default 0 comment('是否有翻倍 0否 1是') TINYINT(1)"` }