Browse Source

分期付

master
huangjiajun 5 months ago
parent
commit
4540786aa5
2 changed files with 6 additions and 4 deletions
  1. +3
    -2
      src/implement/installment_payment_list_db.go
  2. +3
    -2
      src/implement/installment_payment_repaid_flow_db.go

+ 3
- 2
src/implement/installment_payment_list_db.go View File

@@ -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
}

+ 3
- 2
src/implement/installment_payment_repaid_flow_db.go View File

@@ -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
}

Loading…
Cancel
Save