完善套餐与账单接口 & 完善支付数据保存,记录实付价格并关联优惠券
This commit is contained in:
@@ -35,10 +35,12 @@ func newBill(db *gorm.DB, opts ...gen.DOOption) bill {
|
||||
_bill.TradeID = field.NewInt32(tableName, "trade_id")
|
||||
_bill.ResourceID = field.NewInt32(tableName, "resource_id")
|
||||
_bill.RefundID = field.NewInt32(tableName, "refund_id")
|
||||
_bill.CouponID = field.NewInt32(tableName, "coupon_id")
|
||||
_bill.BillNo = field.NewString(tableName, "bill_no")
|
||||
_bill.Info = field.NewString(tableName, "info")
|
||||
_bill.Type = field.NewInt(tableName, "type")
|
||||
_bill.Amount = field.NewField(tableName, "amount")
|
||||
_bill.Actual = field.NewField(tableName, "actual")
|
||||
_bill.User = billBelongsToUser{
|
||||
db: db.Session(&gorm.Session{}),
|
||||
|
||||
@@ -208,10 +210,12 @@ type bill struct {
|
||||
TradeID field.Int32
|
||||
ResourceID field.Int32
|
||||
RefundID field.Int32
|
||||
CouponID field.Int32
|
||||
BillNo field.String
|
||||
Info field.String
|
||||
Type field.Int
|
||||
Amount field.Field
|
||||
Actual field.Field
|
||||
User billBelongsToUser
|
||||
|
||||
Trade billBelongsToTrade
|
||||
@@ -243,10 +247,12 @@ func (b *bill) updateTableName(table string) *bill {
|
||||
b.TradeID = field.NewInt32(table, "trade_id")
|
||||
b.ResourceID = field.NewInt32(table, "resource_id")
|
||||
b.RefundID = field.NewInt32(table, "refund_id")
|
||||
b.CouponID = field.NewInt32(table, "coupon_id")
|
||||
b.BillNo = field.NewString(table, "bill_no")
|
||||
b.Info = field.NewString(table, "info")
|
||||
b.Type = field.NewInt(table, "type")
|
||||
b.Amount = field.NewField(table, "amount")
|
||||
b.Actual = field.NewField(table, "actual")
|
||||
|
||||
b.fillFieldMap()
|
||||
|
||||
@@ -263,7 +269,7 @@ func (b *bill) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
}
|
||||
|
||||
func (b *bill) fillFieldMap() {
|
||||
b.fieldMap = make(map[string]field.Expr, 16)
|
||||
b.fieldMap = make(map[string]field.Expr, 18)
|
||||
b.fieldMap["id"] = b.ID
|
||||
b.fieldMap["created_at"] = b.CreatedAt
|
||||
b.fieldMap["updated_at"] = b.UpdatedAt
|
||||
@@ -272,10 +278,12 @@ func (b *bill) fillFieldMap() {
|
||||
b.fieldMap["trade_id"] = b.TradeID
|
||||
b.fieldMap["resource_id"] = b.ResourceID
|
||||
b.fieldMap["refund_id"] = b.RefundID
|
||||
b.fieldMap["coupon_id"] = b.CouponID
|
||||
b.fieldMap["bill_no"] = b.BillNo
|
||||
b.fieldMap["info"] = b.Info
|
||||
b.fieldMap["type"] = b.Type
|
||||
b.fieldMap["amount"] = b.Amount
|
||||
b.fieldMap["actual"] = b.Actual
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user