新增 修改提现审核状态
This commit is contained in:
@@ -122,3 +122,84 @@ func (r *DoctorWithdrawal) GetDoctorWithdrawalOrderPage(c *gin.Context) {
|
||||
result["data"] = res
|
||||
responses.OkWithData(result, c)
|
||||
}
|
||||
|
||||
// PutDoctorWithdrawalIncome 修改提现个人所得税
|
||||
func (r *DoctorWithdrawal) PutDoctorWithdrawalIncome(c *gin.Context) {
|
||||
doctorWithdrawalRequest := requests.DoctorWithdrawalRequest{}
|
||||
req := doctorWithdrawalRequest.PutDoctorWithdrawalIncome
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
id := c.Param("withdrawal_id")
|
||||
if id == "" {
|
||||
responses.FailWithMessage("缺少参数", c)
|
||||
return
|
||||
}
|
||||
|
||||
// 将 id 转换为 int64 类型
|
||||
withdrawalId, err := strconv.ParseInt(id, 10, 64)
|
||||
if err != nil {
|
||||
responses.Fail(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
doctorWithdrawaService := service.DoctorWithdrawaService{}
|
||||
_, err = doctorWithdrawaService.PutDoctorWithdrawalIncome(req, withdrawalId)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
// PutDoctorWithdrawalExamine 修改提现审核状态
|
||||
func (r *DoctorWithdrawal) PutDoctorWithdrawalExamine(c *gin.Context) {
|
||||
doctorWithdrawalRequest := requests.DoctorWithdrawalRequest{}
|
||||
req := doctorWithdrawalRequest.PutDoctorWithdrawalExamine
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
id := c.Param("withdrawal_id")
|
||||
if id == "" {
|
||||
responses.FailWithMessage("缺少参数", c)
|
||||
return
|
||||
}
|
||||
|
||||
// 将 id 转换为 int64 类型
|
||||
withdrawalId, err := strconv.ParseInt(id, 10, 64)
|
||||
if err != nil {
|
||||
responses.Fail(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 后台用户id
|
||||
adminUserId := c.GetInt64("UserId")
|
||||
|
||||
// 业务处理
|
||||
doctorWithdrawaService := service.DoctorWithdrawaService{}
|
||||
_, err = doctorWithdrawaService.PutDoctorWithdrawalExamine(req, withdrawalId, adminUserId)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user