diff --git a/server/service/qyweixin_approve.go b/server/service/qyweixin_approve.go index 3cacc84..af6c0b6 100644 --- a/server/service/qyweixin_approve.go +++ b/server/service/qyweixin_approve.go @@ -249,9 +249,10 @@ func (a *Approve) handleRefund(detail *qyweixin.ApproveDetail) { } else { err = a.handleRefundWxpay(newData) } - var title string = "【报销成功】" - if err != nil { + if err == nil { + newData.Status = model.ApprovalRefundStatusPayed + } else { title = "【报销失败】" } @@ -270,7 +271,6 @@ func (a *Approve) handleRefund(detail *qyweixin.ApproveDetail) { log.Errorf("send message error :%s", err.Error()) } - newData.Status = model.ApprovalRefundStatusPayed if err := dao.NewApprovalRefundDao().Update(newData); err != nil { log.Errorf("db error :%s", err.Error()) }