From 0a1533fd30ec1a2f4624ccda4ff11f2535ea8a46 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 11 十二月 2024 18:37:14 +0800 Subject: [PATCH] 修改 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CallBackController.java | 30 ++++++++++++++++++++---------- 1 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CallBackController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CallBackController.java index cb4c7b8..38b533c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CallBackController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CallBackController.java @@ -62,6 +62,16 @@ if (check) { one.setPaymentStatus(2); orderService.updateById(one); + if (one.getGoodType()==1){ + try { + TCourse byId = courseService.getById(one.getGoodId()); + byId.setBuyNum(byId.getBuyNum()+1); + courseService.updateById(byId); + }catch (Exception e){ + e.printStackTrace(); + } + + } return R.ok(); }else { return R.fail("请支付"); @@ -86,17 +96,17 @@ one.setPayTime(LocalDateTime.now()); one.setPaymentType(1); - orderService.updateById(one); - if (one.getGoodType()==1){ - try { - TCourse byId = courseService.getById(one.getGoodId()); - byId.setBuyNum(byId.getBuyNum()+1); - courseService.updateById(byId); - }catch (Exception e){ - e.printStackTrace(); - } + orderService.updateById(one); + if (one.getGoodType()==1){ + try { + TCourse byId = courseService.getById(one.getGoodId()); + byId.setBuyNum(byId.getBuyNum()+1); + courseService.updateById(byId); + }catch (Exception e){ + e.printStackTrace(); + } - } + } } return R.ok(null,"SUCCESS"); } -- Gitblit v1.7.1