25 lines
671 B
Go
25 lines
671 B
Go
package gmodel
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// TODO: 使用model的属性做你想做的
|
|
|
|
func (m *FsRefundReasonModel) Create(ctx context.Context, obj *FsRefundReason) error {
|
|
return m.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
|
|
|
return nil
|
|
})
|
|
}
|
|
|
|
func (m *FsRefundReasonModel) Update(ctx context.Context, obj *FsRefundReason) error {
|
|
return m.db.WithContext(ctx).Model(obj).Where("`id` = ?", obj.Id).Updates(obj).Error
|
|
}
|
|
|
|
func (m *FsRefundReasonModel) UpdateByRefundReasonId(ctx context.Context, obj *FsRefundReason) error {
|
|
return m.db.WithContext(ctx).Model(obj).Where("`refund_reason_id` = ?", obj.RefundReasonId).Updates(obj).Error
|
|
}
|