Pu Zhibing
2024-11-01 a85ab71180fdcb02b3cae304ebc96bb2ca12423c
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
@@ -125,7 +125,7 @@
    @GetMapping("/getInfoByType")
    @ApiOperation(tags = {"小程序-兑换商城"},value = "商品查看详情")
    public R getInfoByType(Integer goodType,Integer id) {
    public R getInfoByType(Integer goodType,Integer id,Integer type) {
        if (goodType==1){
        TGoods byId = goodsService.getById(id);
        if (byId==null||byId.getStatus()==2){
@@ -135,7 +135,8 @@
//            for (int i = 0; i < list.size(); i++) {
//                list.get(i).setSalesCount(data.get(i));
//            }
            Integer data = orderClient.getSalesCountByGoodsIdgetCount(byId.getId(), 1, type).getData();
            byId.setSalesCount(data);
        return R.ok(byId);
        }
        else {
@@ -143,7 +144,9 @@
            if (byId==null||byId.getStatus()==2){
                return R.fail(2,"该商品已不存在");
            }
                return R.ok(byId);
            Integer data = orderClient.getSalesCountByGoodsIdgetCount(byId.getId(),2, type).getData();
            byId.setSalesCount(data);
            return R.ok(byId);
            }
    }