|
|
@@ -15,6 +15,22 @@ type InstallmentPaymentListDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (i InstallmentPaymentListDb) UpdateInstallmentPaymentListBySess(sess *xorm.Session, m *models.InstallmentPaymentList, forceColums ...string) (int64, error) { |
|
|
|
var ( |
|
|
|
affected int64 |
|
|
|
err error |
|
|
|
) |
|
|
|
if forceColums != nil { |
|
|
|
affected, err = sess.Where("id=?", m.Id).Cols(forceColums...).Update(m) |
|
|
|
} else { |
|
|
|
affected, err = sess.Where("id=?", m.Id).Update(m) |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
return affected, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) { |
|
|
|
m = new(models.InstallmentPaymentList) |
|
|
|
has, err := i.Db.Where("id =?", id).Get(m) |
|
|
|