request()->input('goods_id'), 'total' => request()->input('total'), 'option_id' => request()->input('option_id'), ]; $result = new MemberCartCollection(); $result->push(MemberCartService::newMemberCart($goods_params)); event(new \app\common\events\goods\BeforeSaveGoodsVerify(request()->input('goods_id'), request()->input('total'))); return $result; } /** * @throws \app\common\exceptions\ShopException */ protected function validateParam() { $this->validate([ 'goods_id' => 'required|integer', 'option_id' => 'integer', 'total' => 'integer|min:1', ]); } /** * @return \Illuminate\Http\JsonResponse * @throws \app\common\exceptions\ShopException */ public function index() { $this->validateParam(); $trade = $this->getMemberCarts()->getTrade(); return $this->successJson('成功', $trade); } }