提交 fa17364c authored 作者: 吴德鹏's avatar 吴德鹏

修改商品置顶bug

上级 08222439
...@@ -239,6 +239,8 @@ public class TbCfStationItemController extends ApiBaseAction { ...@@ -239,6 +239,8 @@ public class TbCfStationItemController extends ApiBaseAction {
return R.ok(); return R.ok();
} else if (res == -1) { } else if (res == -1) {
return R.error("该商品已下架,不能置顶"); return R.error("该商品已下架,不能置顶");
} else if (res == -2) {
return R.error("最多置顶96个商品");
} }
return R.error("置顶失败"); return R.error("置顶失败");
} }
......
...@@ -486,6 +486,10 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -486,6 +486,10 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
if ("2".equals(String.valueOf(item.getEnableFlag()))) { if ("2".equals(String.valueOf(item.getEnableFlag()))) {
return -1; return -1;
} }
int topCount = tbCfStationItemDao.queryTopCount();
if (topCount >= 96) {
return -2;
}
item.setItemTop(1); item.setItemTop(1);
int maxSort = tbCfStationItemDao.maxSort(); int maxSort = tbCfStationItemDao.maxSort();
item.setSort(++maxSort); item.setSort(++maxSort);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论