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