/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store() { if (!Request::has('_id', 'type')) { return failure('参数错误'); } $type = Request::input('type', 1); $id = Request::input('_id'); $withdraw = UserWithdraw::find($id); if (!$withdraw) { return failure('该条数据不存在'); } $user = User::find($withdraw->user_id); if (!$user) { return failure('该用户不存在'); } if ($type) { $r = $withdraw->setSuccess($user); } else { $r = $withdraw->setFailure($user); } if ($r) { return success('提现成功'); } return failure('提现失败'); }