|
|
|
@ -131,7 +131,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Map<String,Object> getGoodsByMap(Map gmap, int limit) { |
|
|
|
public Map<String,Object> getGoodsByMap(Map gmap, int page,int limit) { |
|
|
|
Map retmap =new HashMap(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
@ -163,10 +163,18 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
int total = goodsMapper.goodsCount(gmap); |
|
|
|
retmap.put("total",total); |
|
|
|
|
|
|
|
int start = page>1?(page-1)*limit:0; |
|
|
|
int end =page*limit; |
|
|
|
|
|
|
|
// 总的页
|
|
|
|
int totalpage = (int)Math.ceil(total/limit); |
|
|
|
retmap.put("last_page",totalpage); |
|
|
|
retmap.put("per_page",limit); |
|
|
|
retmap.put("start",start); |
|
|
|
retmap.put("end",end); |
|
|
|
retmap.put("curr_page",page); |
|
|
|
retmap.put("per_page",limit); |
|
|
|
|
|
|
|
|
|
|
|
return retmap; |
|
|
|
} |
|
|
|
|