diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java index 9cb7a20..cb89516 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java @@ -63,6 +63,9 @@ public class StoreGoodsController extends BaseController @Autowired private IStoreSpecGoodsPriceService storeSpecGoodsPriceService; + @Autowired + private IStoreGoodsCateService storeGoodsCateService; + @RequiresPermissions("shop:goods:view") @GetMapping() public String goods() @@ -477,6 +480,9 @@ public class StoreGoodsController extends BaseController public String edit(@PathVariable("goodsId") Integer goodsId, ModelMap mmap) { StoreGoods storeGoods = storeGoodsService.selectStoreGoodsById(goodsId); + StoreGoodsCate storeGoodsCate = storeGoodsCateService + .selectStoreGoodsCateById(storeGoods.getCateId()); + storeGoods.setCateName(storeGoodsCate.getCateTitle()); mmap.put("storeGoods", storeGoods); return prefix + "/edit"; } diff --git a/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html b/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html index 384d5a3..9a0683a 100644 --- a/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html +++ b/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html @@ -12,7 +12,7 @@
- +
diff --git a/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java b/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java index f15afca..8425214 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java +++ b/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java @@ -24,6 +24,8 @@ public class StoreGoods extends BaseEntity private String brandName; + private String cateName; + //private /** 扩展分类id */ @@ -165,6 +167,14 @@ public class StoreGoods extends BaseEntity /** 视频 */ private String goodsVideo; + public String getCateName() { + return cateName; + } + + public void setCateName(String cateName) { + this.cateName = cateName; + } + public String getBrandName() { return brandName; }