修改医生账户位数
This commit is contained in:
parent
a4fdd63161
commit
ec599b1f18
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"math"
|
||||
)
|
||||
|
||||
type DoctorAccountDto struct {
|
||||
@ -26,11 +27,11 @@ func GetDoctorAccountDto(m *model.DoctorAccount) *DoctorAccountDto {
|
||||
return &DoctorAccountDto{
|
||||
AccountId: fmt.Sprintf("%d", m.AccountId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
TotalAmount: m.TotalAmount,
|
||||
BalanceAccount: m.BalanceAccount,
|
||||
AppliedWithdrawalAmount: m.AppliedWithdrawalAmount,
|
||||
ActualWithdrawalAmount: m.ActualWithdrawalAmount,
|
||||
IncomeTax: m.IncomeTax,
|
||||
TotalAmount: math.Floor(m.TotalAmount*100) / 100,
|
||||
BalanceAccount: math.Floor(m.BalanceAccount*100) / 100,
|
||||
AppliedWithdrawalAmount: math.Floor(m.AppliedWithdrawalAmount*100) / 100,
|
||||
ActualWithdrawalAmount: math.Floor(m.ActualWithdrawalAmount*100) / 100,
|
||||
IncomeTax: math.Floor(m.IncomeTax*100) / 100,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
@ -45,11 +46,11 @@ func GetDoctorAccountListDto(m []*model.DoctorAccount) []*DoctorAccountDto {
|
||||
response := &DoctorAccountDto{
|
||||
AccountId: fmt.Sprintf("%d", v.AccountId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
TotalAmount: v.TotalAmount,
|
||||
BalanceAccount: v.BalanceAccount,
|
||||
AppliedWithdrawalAmount: v.AppliedWithdrawalAmount,
|
||||
ActualWithdrawalAmount: v.ActualWithdrawalAmount,
|
||||
IncomeTax: v.IncomeTax,
|
||||
TotalAmount: math.Floor(v.TotalAmount*100) / 100,
|
||||
BalanceAccount: math.Floor(v.BalanceAccount*100) / 100,
|
||||
AppliedWithdrawalAmount: math.Floor(v.AppliedWithdrawalAmount*100) / 100,
|
||||
ActualWithdrawalAmount: math.Floor(v.ActualWithdrawalAmount*100) / 100,
|
||||
IncomeTax: math.Floor(v.IncomeTax*100) / 100,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
@ -401,8 +401,8 @@ func (r *OrderInquiryService) GetOrderInquiryDoctorAmount(inquiryStatus int, amo
|
||||
if inquiryStatus == 4 || inquiryStatus == 5 || inquiryStatus == 6 {
|
||||
doctorAmount, _ = decimal.NewFromFloat(amountTotal).
|
||||
Mul(decimal.NewFromFloat(0.75)).
|
||||
Mul(decimal.NewFromFloat(100000)).Floor().
|
||||
Div(decimal.NewFromFloat(100000)).Float64()
|
||||
Mul(decimal.NewFromFloat(100)).Floor().
|
||||
Div(decimal.NewFromFloat(100)).Float64()
|
||||
}
|
||||
|
||||
return doctorAmount
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user