| | |
| | | |
| | | @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){ |
| | |
| | | // 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 { |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |