find($userId); $res = $user->fill($data)->save(); if (!$res) { throw new ErrorCodeException(ErrorCode::USER_INFO_UPDATE_ERROR); } return $res; } public function check($userId) { return User::query()->where(['status' => 1, 'id' => $userId])->exists(); } public function undo($userId) { // TODO: Implement undo() method. } public function detail($userId) { return User::query() ->select(['id', 'nick_name', 'avatar', 'openid', 'total_score', 'real_name']) ->where(['status' => 1, 'id' => $userId]) ->first()->toArray(); } }