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