@@ -1,8 +1,9 @@ | |||||
package dao | |||||
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" | ||||
type InstallmentPaymentSchemeDao interface { | type InstallmentPaymentSchemeDao interface { | ||||
InsertInstallmentPaymentScheme(m *models.InstallmentPaymentScheme) (id int, err error) | InsertInstallmentPaymentScheme(m *models.InstallmentPaymentScheme) (id int, err error) | ||||
GetInstallmentPaymentSchemeById(id int) (m *models.InstallmentPaymentScheme, err error) | GetInstallmentPaymentSchemeById(id int) (m *models.InstallmentPaymentScheme, err error) | ||||
FindInstallmentPaymentScheme() (m *[]models.InstallmentPaymentScheme, err error) | |||||
} | } |
@@ -1,5 +1,7 @@ | |||||
package dao | |||||
package dao | |||||
import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
type InstallmentPaymentSchemeWithGoodsDao interface { | type InstallmentPaymentSchemeWithGoodsDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
GetInstallmentPaymentSchemeGoodsByGoodsId(goodsId int) (m *models.InstallmentPaymentSchemeWithGoods, err error) | |||||
} | } |
@@ -1,4 +1,4 @@ | |||||
package implement | |||||
package implement | |||||
import ( | import ( | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | "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 | 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 | |||||
} |
@@ -1,7 +1,9 @@ | |||||
package implement | |||||
package implement | |||||
import ( | import ( | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | "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" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -12,3 +14,14 @@ type InstallmentPaymentSchemeWithGoodsDb struct { | |||||
func NewInstallmentPaymentSchemeWithGoodsDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeWithGoodsDao { | func NewInstallmentPaymentSchemeWithGoodsDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeWithGoodsDao { | ||||
return &InstallmentPaymentSchemeWithGoodsDb{Db: engine} | 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 | |||||
} |