新增 回滚关联订单数据
This commit is contained in:
parent
5e5d25f1bd
commit
9c0d7e94b7
@ -526,7 +526,7 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
||||
// 修改提现审核状态
|
||||
withdrawalGroup.PUT("/examine/:withdrawal_id", api.DoctorWithdrawal.PutDoctorWithdrawalExamine)
|
||||
|
||||
// 修改打款审核状态
|
||||
// 修改打款状态
|
||||
withdrawalGroup.PUT("/payment/:withdrawal_id", api.OrderPrescription.GetOrderPrescriptionPage)
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ func (r *DoctorWithdrawaService) PutDoctorWithdrawalExamine(req requests.PutDoct
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 返还医生账户金额
|
||||
// 返还医生账户金额-审核不通过
|
||||
if req.ExamineStatus == 3 {
|
||||
// 获取医生账户数据
|
||||
doctorAccountDao := dao.DoctorAccountDao{}
|
||||
@ -224,6 +224,34 @@ func (r *DoctorWithdrawaService) PutDoctorWithdrawalExamine(req requests.PutDoct
|
||||
tx.Rollback()
|
||||
return false, err
|
||||
}
|
||||
|
||||
// 获取医生提现-关联订单数据
|
||||
doctorWithdrawalOrderDao := dao.DoctorWithdrawalOrderDao{}
|
||||
doctorWithdrawalOrders, err := doctorWithdrawalOrderDao.GetDoctorWithdrawalOrderByWithdrawalId(withdrawalId)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("关联订单数据错误")
|
||||
}
|
||||
|
||||
// 修改问诊订单提现状态
|
||||
for _, v := range doctorWithdrawalOrders {
|
||||
// 获取订单数据
|
||||
orderInquiryDao := dao.OrderInquiryDao{}
|
||||
orderInquiry, err := orderInquiryDao.GetOrderInquiryById(v.OrderInquiryId)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("关联订单数据错误")
|
||||
}
|
||||
|
||||
orderInquiryData := make(map[string]interface{})
|
||||
orderInquiryData["is_withdrawal"] = 0
|
||||
orderInquiryData["withdrawal_time"] = nil
|
||||
err = orderInquiryDao.EditOrderInquiryById(tx, orderInquiry.OrderInquiryId, orderInquiryData)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("回滚关联订单数据失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user