Browse Source

分期付

master
huangjiajun 4 months ago
parent
commit
d29aad4d83
4 changed files with 29 additions and 5 deletions
  1. +2
    -1
      src/dao/installment_payment_scheme_dao.go
  2. +4
    -2
      src/dao/installment_payment_scheme_with_goods_dao.go
  3. +9
    -1
      src/implement/installment_payment_scheme_db.go
  4. +14
    -1
      src/implement/installment_payment_scheme_with_goods_db.go

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

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

+ 4
- 2
src/dao/installment_payment_scheme_with_goods_dao.go View File

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

+ 9
- 1
src/implement/installment_payment_scheme_db.go View File

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

+ 14
- 1
src/implement/installment_payment_scheme_with_goods_db.go View File

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

Loading…
Cancel
Save