* @Date:2019-04-15T09:21:38+0800 * @return [type] [description] */ public function index(Request $request) { $list = Goods::where('status', 1)->where('type', 1)->orderBy('price', 'desc')->paginate(); return GoodsListResource::collection($list)->additional([ 'status' => 'SUCCESS', 'status_code' => 0, ]); } //开通会员 public function vip() { $goods = Goods::where('status', 1)->where('type', 2)->first(); if ($goods) { return $this->success(new GoodsResource($goods)); } else { return $this->failed('没有找到升级产品'); } } public function show(Goods $goods) { return $this->success(new GoodsResource($goods)); } }