Commit b7493531 authored by Junling Bu's avatar Junling Bu
Browse files

update[litemall-wx-api]:查询商品时返回商品所属类目

parent 09221552
......@@ -186,8 +186,19 @@ public class WxGoodsController {
List<LitemallGoods> goodsList = goodsService.querySelective(categoryId, brandId, keyword, isHot, isNew, page, size, sortWithOrder);
int total = goodsService.countSelective(categoryId, brandId, keyword, isHot, isNew, page, size, sortWithOrder);
List<Integer> cats = new ArrayList<Integer>();
for(LitemallGoods goods : goodsList){
cats.add(goods.getCategoryId());
}
List<LitemallCategory> categoryList = null;
if(cats.size() != 0) {
categoryList = categoryService.queryL2ByIds(cats);
}
Map<String, Object> data = new HashMap();
data.put("goodsList", goodsList);
data.put("filterCategory", categoryList);
data.put("count", total);
return ResponseUtil.ok(data);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment