@@ -1,4 +1,4 @@ | |||||
package dao | |||||
package dao | |||||
import ( | import ( | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | ||||
@@ -7,6 +7,7 @@ import ( | |||||
type InstallmentPaymentListDao interface { | type InstallmentPaymentListDao interface { | ||||
GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) | 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) | UpdateInstallmentPaymentListBySess(sess *xorm.Session, m *models.InstallmentPaymentList, forceColums ...string) (int64, error) | ||||
InsertInstallmentPaymentList(m *models.InstallmentPaymentList) (id int, err error) | InsertInstallmentPaymentList(m *models.InstallmentPaymentList) (id int, err error) | ||||
} | } |
@@ -1,4 +1,4 @@ | |||||
package dao | |||||
package dao | |||||
import ( | import ( | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | ||||
@@ -7,4 +7,5 @@ import ( | |||||
type InstallmentPaymentRepaidFlowDao interface { | type InstallmentPaymentRepaidFlowDao interface { | ||||
InsertInstallmentPaymentRepaidFlowBySession(session *xorm.Session, m *models.InstallmentPaymentRepaidFlow) (id int, err error) | InsertInstallmentPaymentRepaidFlowBySession(session *xorm.Session, m *models.InstallmentPaymentRepaidFlow) (id int, err error) | ||||
FinInstallmentRepaidFlow(arg map[string]string) (m *[]models.InstallmentPaymentRepaidFlow, err error) | |||||
} | } |
@@ -1,8 +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" | "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" | zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | ||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -51,3 +52,16 @@ func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *mode | |||||
} | } | ||||
return m, nil | 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 | |||||
} |
@@ -1,8 +1,10 @@ | |||||
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" | "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" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -21,3 +23,13 @@ func (i InstallmentPaymentRepaidFlowDb) InsertInstallmentPaymentRepaidFlowBySess | |||||
} | } | ||||
return m.Id, nil | 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 | |||||
} |
@@ -9,6 +9,8 @@ type InstallmentPaymentList struct { | |||||
InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` | 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)"` | 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)"` | 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)"` | 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"` | 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"` | UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` | ||||