如何查表后生成json数据 求解答
需要生成如下的json
?{
"response": "cart",
"cart":{
listmap "cartitem": [ //购物车项
:{ ---product
map--> "product":{
"id":"1200001", //商品ID
"name": "雅培金装", //商品名称
"pic":"", //商品图片URL
"price":"89", //商品售价
"number": 0, //商品库存数量,0为缺货或下架
"uplimit":"10" //商品购买数量上限
listmap -------> "product_property":[ //属性
{
"key": "颜色",
"value": "红色",
},
{
"key": "大小",
"value": "M",
}
],
"isgift":"false" //是否赠品
}
"prodNum":3 //商品数量
},
{
"product":{
"id":"1200001", //商品ID
"name": "雅培金装", //商品名称
"pic":"", //商品图片URL
"price":"89", //商品售价
"number": 0, //商品库存数量,0为缺货或下架
"uplimit":"10", //商品购买数量上限
"product_property":[ //属性
{
"key": "颜色",
"value": "红色",
},
{
"key": "大小",
"value": "M",
}
]
"isgift":"true" //是否赠品
},
"prodNum":1 //商品数量
}
],
"prom":[ //享受促销信息
"促销信息一",
"促销信息二"
],
//购物车总计
"totalCount":"3", //商品数量总计
"totalPrice":"230", //商品金额总计
"totalPoint":"230" //商品积分总计
}
}