Browse Source

add 分付数据表

master
dengbiao 1 week ago
parent
commit
42ff22d419
4 changed files with 39 additions and 3 deletions
  1. +1
    -0
      src/dao/installment_payment_list_dao.go
  2. +4
    -1
      src/dao/installment_payment_scheme_dao.go
  3. +9
    -0
      src/implement/installment_payment_list_db.go
  4. +25
    -2
      src/implement/installment_payment_scheme_db.go

+ 1
- 0
src/dao/installment_payment_list_dao.go View File

@@ -8,4 +8,5 @@ import (
type InstallmentPaymentListDao interface {
GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error)
UpdateInstallmentPaymentListBySess(sess *xorm.Session, m *models.InstallmentPaymentList, forceColums ...string) (int64, error)
InsertInstallmentPaymentList(m *models.InstallmentPaymentList) (id int, err error)
}

+ 4
- 1
src/dao/installment_payment_scheme_dao.go View File

@@ -1,5 +1,8 @@
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type InstallmentPaymentSchemeDao interface {
//TODO:: You can add specific method definitions here
InsertInstallmentPaymentScheme(m *models.InstallmentPaymentScheme) (id int, err error)
GetInstallmentPaymentSchemeById(id int) (m *models.InstallmentPaymentScheme, err error)
}

+ 9
- 0
src/implement/installment_payment_list_db.go View File

@@ -15,6 +15,15 @@ type InstallmentPaymentListDb struct {
Db *xorm.Engine
}

func (i InstallmentPaymentListDb) InsertInstallmentPaymentList(m *models.InstallmentPaymentList) (id int, err error) {
_, err = i.Db.InsertOne(m)
if err != nil {
return 0, err
}
id = m.Id
return id, nil
}

func (i InstallmentPaymentListDb) UpdateInstallmentPaymentListBySess(sess *xorm.Session, m *models.InstallmentPaymentList, forceColums ...string) (int64, error) {
var (
affected int64


+ 25
- 2
src/implement/installment_payment_scheme_db.go View File

@@ -2,13 +2,36 @@

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"
)

func NewInstallmentPaymentSchemeDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeDao {
return &InstallmentPaymentSchemeDb{Db: engine}
}

type InstallmentPaymentSchemeDb struct {
Db *xorm.Engine
}

func NewInstallmentPaymentSchemeDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeDao {
return &InstallmentPaymentSchemeDb{Db: engine}
func (i InstallmentPaymentSchemeDb) InsertInstallmentPaymentScheme(m *models.InstallmentPaymentScheme) (id int, err error) {
_, err = i.Db.InsertOne(m)
if err != nil {
return 0, err
}
id = m.Id
return id, nil
}

func (i InstallmentPaymentSchemeDb) GetInstallmentPaymentSchemeById(id int) (m *models.InstallmentPaymentScheme, err error) {
m = new(models.InstallmentPaymentScheme)
has, err := i.Db.Where("id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

Loading…
Cancel
Save