services = $services; } /** * 获取优惠商品列表 * @param Request $request * @return mixed */ public function index(Request $request) { [$product_id] = $request->postMore([ ['product_id', 0] ], true); $uid = (int)$request->uid(); if (!$product_id) return app('json')->fail('参数错误'); $list = $this->services->getDiscounts((int)$product_id, $uid); return $list ? app('json')->successful($list) : app('json')->fail('活动商品已下架'); } }