作者 何书鹏

订单显示商品ID

... ... @@ -49,22 +49,14 @@ class Order extends Api
"receipt_status": "10", 10未收货20已收货
"order_status": "10", 10进行中20已取消30已完成
"total_sum": 0, 商品总数量
"goods": [
{
"goods": [{
"goods_id": 1, 商品ID
"goods_name": "asdasd", 商品名
"goods_attr": "1", 规格名
"total_num": 0, 数量
"total_price": "0.00", 价格
"image_text": "" 图片
},
{
"goods_name": "asdasd",
"goods_attr": "1",
"total_num": 0,
"total_price": "0.00",
"image_text": ""
}
],
}],
"createtime_text": "" 时间
}
]
... ... @@ -128,7 +120,7 @@ class Order extends Api
$sum = 0;
foreach ($item->getRelation('goods')as $key => $value){
$sum += $value['total_num'];
$value->visible(['goods_name','goods_attr','total_num','total_price']);
$value->visible(['goods_id','goods_name','goods_attr','total_num','total_price']);
}
$item['total_sum'] = $sum;
$item->visible([
... ...