model = new UserMoneyLog(); } /** * 添加 * @param int $userId * @throws Throwable */ public function add(int $userId = 0): void { if ($this->request->isPost()) { parent::add(); } $user = User::where('id', $userId)->find(); if (!$user) { $this->error(__("The user can't find it")); } $this->success('', [ 'user' => $user ]); } }