教程里修改category的时候缺了一个步骤吧
来源:11-4 卖家类目功能开发
慕运维1357726
2020-01-14
修改了product category table里面的category type,但是没有修改相应的product info里面的category type。应该要把修改的那个type对应的product查出来,再去修改其在product info table里面的category type。这一步好像视频里面没有?
写回答
2回答
-
weixin_慕函数0247231
2021-02-23
可以在ProductService里增加一个方法findByCategoryType
//category存在,需要修改product的categoryType if (form.getCategoryId() != null) { productCategory = categoryService.findOne(form.getCategoryId()); List<ProductInfo> productInfoList = productService.findByCategoryType(productCategory.getCategoryType()); for (ProductInfo productInfo : productInfoList) { productInfo.setCategoryType(form.getCategoryType()); productService.save(productInfo); } }00 -
廖师兄
2020-01-14
嗯,这个地方没做关联,应该要修改product的category_type
00
相似问题