新增获取医生提现列表-分页

This commit is contained in:
2023-10-30 10:25:44 +08:00
parent 409de1661d
commit f65d7b8414
8 changed files with 451 additions and 2 deletions
+47
View File
@@ -0,0 +1,47 @@
package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// DoctorWithdrawal 医生提现表
type DoctorWithdrawal struct {
WithdrawalId int64 `gorm:"column:withdrawal_id;type:bigint(19);primary_key;comment:主键id" json:"withdrawal_id"`
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id;NOT NULL" json:"doctor_id"`
BankId int64 `gorm:"column:bank_id;type:bigint(19);comment:银行id" json:"bank_id"`
AccountName string `gorm:"column:account_name;type:varchar(50);comment:银行卡姓名;NOT NULL" json:"account_name"`
BankCardCode string `gorm:"column:bank_card_code;type:varchar(100);comment:银行卡号" json:"bank_card_code"`
BankCardCodeFour string `gorm:"column:bank_card_code_four;type:varchar(10);comment:银行卡号(后四位);NOT NULL" json:"bank_card_code_four"`
AppliedWithdrawalAmount float64 `gorm:"column:applied_withdrawal_amount;type:decimal(10,2);default:0.00;comment:提现金额" json:"applied_withdrawal_amount"`
ActualWithdrawalAmount float64 `gorm:"column:actual_withdrawal_amount;type:decimal(10,2);default:0.00;comment:实际提现金额" json:"actual_withdrawal_amount"`
IncomeTax float64 `gorm:"column:income_tax;type:decimal(10,2);default:0.00;comment:提现所得税金额" json:"income_tax"`
ExamineStatus int `gorm:"column:examine_status;type:tinyint(4);default:0;comment:审核状态(1:审核中 2:审核通过 3:审核未通过)" json:"examine_status"`
ExamineFailReason string `gorm:"column:examine_fail_reason;type:varchar(255);comment:审核失败原因" json:"examine_fail_reason"`
ExamineTime LocalTime `gorm:"column:examine_time;type:datetime;comment:审核日期" json:"examine_time"`
ExamineBy int64 `gorm:"column:examine_by;type:bigint(19);comment:审核人员id(后台用户id" json:"examine_by"`
PaymentStatus int `gorm:"column:payment_status;type:tinyint(1);default:0;comment:财务打款状态(0:否 1:是)" json:"payment_status"`
PaymentTime LocalTime `gorm:"column:payment_time;type:datetime;comment:财务打款时间" json:"payment_time"`
PaymentBy int64 `gorm:"column:payment_by;type:bigint(19);comment:财务打款人员id(后台用户id" json:"payment_by"`
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
Model
}
func (m *DoctorWithdrawal) TableName() string {
return "gdxz_doctor_withdrawal"
}
func (m *DoctorWithdrawal) BeforeCreate(tx *gorm.DB) error {
if m.WithdrawalId == 0 {
m.WithdrawalId = global.Snowflake.Generate().Int64()
}
m.CreatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
m.UpdatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
return nil
}
+34
View File
@@ -0,0 +1,34 @@
package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// DoctorWithdrawalOrder 医生提现-关联订单表
type DoctorWithdrawalOrder struct {
WithdrawalOrderId int64 `gorm:"column:withdrawal_order_id;type:bigint(19);primary_key;comment:主键id" json:"withdrawal_order_id"`
WithdrawalId int64 `gorm:"column:withdrawal_id;type:bigint(19);comment:提现表id;NOT NULL" json:"withdrawal_id"`
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id;NOT NULL" json:"doctor_id"`
OrderInquiryId int64 `gorm:"column:order_inquiry_id;type:bigint(19);comment:订单-问诊id;NOT NULL" json:"order_inquiry_id"`
Model
}
func (m *DoctorWithdrawalOrder) TableName() string {
return "gdxz_doctor_withdrawal_order"
}
func (m *DoctorWithdrawalOrder) BeforeCreate(tx *gorm.DB) error {
if m.WithdrawalOrderId == 0 {
m.WithdrawalOrderId = global.Snowflake.Generate().Int64()
}
m.CreatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
m.UpdatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
return nil
}