Skip to content

Commit

Permalink
🐛 Fixing a bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
newbee-mall committed May 24, 2020
1 parent 8b1fd3e commit 7a7cca6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public String searchPage(@RequestParam Map<String, Object> params, HttpServletRe
}
request.setAttribute("keyword", keyword);
params.put("keyword", keyword);
//搜索上架状态下的商品
params.put("goodsSellStatus", Constants.SELL_STATUS_UP);
//封装商品数据
PageQueryUtil pageUtil = new PageQueryUtil(params);
request.setAttribute("pageResult", newBeeMallGoodsService.searchNewBeeMallGoods(pageUtil));
Expand All @@ -77,7 +79,7 @@ public String detailPage(@PathVariable("goodsId") Long goodsId, HttpServletReque
if (goods == null) {
NewBeeMallException.fail(ServiceResultEnum.GOODS_NOT_EXIST.getResult());
}
if (Constants.SELL_STATUS_UP != goods.getGoodsSellStatus()){
if (Constants.SELL_STATUS_UP != goods.getGoodsSellStatus()) {
NewBeeMallException.fail(ServiceResultEnum.GOODS_PUT_DOWN.getResult());
}
NewBeeMallGoodsDetailVO goodsDetailVO = new NewBeeMallGoodsDetailVO();
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/mapper/NewBeeMallGoodsMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
<if test="goodsCategoryId!=null and goodsCategoryId!=''">
and goods_category_id = #{goodsCategoryId}
</if>
<if test="goodsSellStatus!=null">
and goods_sell_status = #{goodsSellStatus}
</if>
</where>
<if test="orderBy!=null and orderBy!=''">
<choose>
Expand Down Expand Up @@ -127,6 +130,9 @@
<if test="goodsCategoryId!=null and goodsCategoryId!=''">
and goods_category_id = #{goodsCategoryId}
</if>
<if test="goodsSellStatus!=null">
and goods_sell_status = #{goodsSellStatus}
</if>
</where>
</select>

Expand Down

0 comments on commit 7a7cca6

Please sign in to comment.