$data = Goods::select('id','marketprice','salesprice','picurl','title')->where('status',1)->get();
// 返回
data{
"id": 46,
"marketprice": "35.00",
"salesprice": "25.00",
"picurl": "picture/uploads/goods/2_1490750511_0.jpg",
"title": "title"
}
// 我想在data里面在上url
$url =url('/'.$data->id);
data{
"id": 46,
"marketprice": "35.00",
"salesprice": "25.00",
"picurl": "picture/uploads/goods/2_1490750511_0.jpg",
"title": "title",
"url": "www.baidu.com/46",
}
// 实现这个效果,怎么实现 - -
修改的评论也不能少于六个字哦!
0
分享