feat: update models
This commit is contained in:
@@ -53,6 +53,12 @@ func (w *WechatRefundNotifyWorker) Work(ctx context.Context, job *Job[WechatRefu
|
||||
return err
|
||||
}
|
||||
|
||||
user, err := model.UsersModel.GetByID(context.Background(), order.UserID)
|
||||
if err != nil {
|
||||
log.Errorf("GetByID error:%v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
meta := order.Meta.Data
|
||||
meta.RefundNotify = notify
|
||||
order.Status = fields.OrderStatusRefundProcessing
|
||||
@@ -76,7 +82,7 @@ func (w *WechatRefundNotifyWorker) Work(ctx context.Context, job *Job[WechatRefu
|
||||
defer tx.Rollback()
|
||||
|
||||
if order.Status == fields.OrderStatusRefundSuccess {
|
||||
if err := model.UsersModel.RevokePosts(context.Background(), order.UserID, order.PostID); err != nil {
|
||||
if err := user.RevokePosts(context.Background(), order.PostID); err != nil {
|
||||
log.Errorf("RevokePosts error:%v", err)
|
||||
return errors.Wrap(err, "RevokePosts error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user