|
|
|
@ -216,7 +216,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
glmap.put("goods_type", gl.getGoods_type()); |
|
|
|
glmap.put("goods_status", gl.getGoods_status()); |
|
|
|
glmap.put("goods_detail_id", gl.getGoods_detail_id()); |
|
|
|
glmap.put("is_recommend", gl.getIsRecommend()); |
|
|
|
glmap.put("is_recommend", gl.getIs_recommend()); |
|
|
|
glmap.put("entrust_status", gl.getEntrust_status()); |
|
|
|
glmap.put("charges_type", gl.getCharges_type()); |
|
|
|
glmap.put("price", gl.getPrice()); |
|
|
|
@ -536,29 +536,36 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
@Override |
|
|
|
public List getTypeGoods(String type, String createtime, String goods_type) { |
|
|
|
// 商品列表
|
|
|
|
List<Goods> glist = new ArrayList<>(); |
|
|
|
String where = "";//查询条件
|
|
|
|
Map qmap = new HashMap();//查询条件
|
|
|
|
qmap.put("g.is_deleted",0); |
|
|
|
int limit=8; |
|
|
|
String orderKey="g.id"; //排序字段
|
|
|
|
if ("1".equals(type)) { |
|
|
|
glist = goodsMapper.getGoodsByCondition("1=1", 10, "click_count", "DESC"); |
|
|
|
limit=10; |
|
|
|
orderKey="click_count"; |
|
|
|
} |
|
|
|
if ("2".equals(type)) { |
|
|
|
glist = goodsMapper.getGoodsByCondition("1=1", 10, "sale_count", "DESC"); |
|
|
|
limit=10; |
|
|
|
orderKey="click_count"; |
|
|
|
} |
|
|
|
if ("3".equals(type)) { |
|
|
|
where = "is_recommend=1 and goods_status=1"; |
|
|
|
glist = goodsMapper.getGoodsByCondition(where, 8, "recommend_sort", "DESC"); |
|
|
|
orderKey="recommend_sort"; |
|
|
|
qmap.put("g.is_recommend",1); |
|
|
|
qmap.put("g.goods_status",1); |
|
|
|
} |
|
|
|
List<GoodsListVo> glist = goodsMapper.getGoodsVoList(qmap,orderKey,"DESC",limit,0); |
|
|
|
|
|
|
|
//填充信息
|
|
|
|
List retlist = new ArrayList(); |
|
|
|
for (Goods g : glist) { |
|
|
|
for (GoodsListVo g : glist) { |
|
|
|
Map tgmap =new HashMap(); |
|
|
|
//List tmpglist =new ArrayList();
|
|
|
|
JSONObject tmpjson = (JSONObject) JSON.toJSON(g); |
|
|
|
tgmap= JSONObject.parseObject(tmpjson.toJSONString()); |
|
|
|
//
|
|
|
|
GoodsDetail gd = goodsDetailMapper.getGoodsDetailBygid(g.getGoodsDetailId()); |
|
|
|
//GoodsDetail gd = goodsDetailMapper.getGoodsDetailBygid(g.getGoodsDetailId());
|
|
|
|
//add
|
|
|
|
tgmap.put("entrust_month",gd.getContractualPeriod()); |
|
|
|
tgmap.put("entrust_month",g.getContractual_period()); |
|
|
|
retlist.add(tgmap); |
|
|
|
|
|
|
|
} |
|
|
|
|