|
@@ -53,8 +53,8 @@ public class H5IndexController extends AbstractController {
|
|
|
private String myhost;
|
|
|
|
|
|
@RequestMapping("/index")
|
|
|
- public String index(Model model, @RequestParam(name="label", required=false) Integer label){
|
|
|
- List<GoodBean> beans = this.getGoodList(label);
|
|
|
+ public String index(Model model, @RequestParam(name="search", required=false) String search, @RequestParam(name="label", required=false) Integer label){
|
|
|
+ List<GoodBean> beans = this.getGoodList(label, search);
|
|
|
List<SysLabel> labels = this.queryAllSysLabel();
|
|
|
List<Banner> banners = bannerService.queryAllOnline();
|
|
|
|
|
@@ -80,16 +80,16 @@ public class H5IndexController extends AbstractController {
|
|
|
return "/h5/detail";
|
|
|
}
|
|
|
|
|
|
- private List<GoodBean> getGoodList(Integer lid){
|
|
|
+ private List<GoodBean> getGoodList(Integer lid, String search){
|
|
|
List<GoodBase> goodList = null;
|
|
|
if (lid == null){
|
|
|
- goodList = goodService.queryGoodBases(null, GoodService.GOOD_ONLINE, 1, 10);
|
|
|
+ goodList = goodService.queryAllGoodBases(search, GoodService.GOOD_ONLINE, null);
|
|
|
}else{
|
|
|
List<Integer> gids = sysLabelService.queryLabelGoods(lid).stream().map(obj -> obj.getGid()).collect(Collectors.toList());
|
|
|
if (gids.isEmpty()){
|
|
|
goodList = new ArrayList<>();
|
|
|
}else{
|
|
|
- goodList = goodService.queryGoodBases(gids, GoodService.GOOD_ONLINE);
|
|
|
+ goodList = goodService.queryAllGoodBases(search, GoodService.GOOD_ONLINE, gids);
|
|
|
}
|
|
|
}
|
|
|
List<GoodBean> beans = new ArrayList<>();
|