30 lines
691 B
PHP
30 lines
691 B
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: sunny
|
|
* Date: 2019/2/11
|
|
* Time: 4:41 PM
|
|
*/
|
|
|
|
namespace App\Api\Resources;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
class OrderGoodsListResource extends JsonResource
|
|
{
|
|
/**
|
|
* 小程序,某订单的商品列表数据项
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'goods_name' => $this->item->getTitle(),
|
|
'number' =>$this->number,
|
|
'price'=> $this->price,
|
|
'pic_url'=> $this->item->storage->path ? 'http://www.bohaimingpin.com'.$this->item->storage->path : '',
|
|
];
|
|
}
|
|
} |