argument('user_id'); $amount = $this->argument('amount'); $user = User::findOrFail($user_id); $transaction = new Transaction(); $current_drops = $transaction->getDrops($user->id); $this->info($user->name . ', 当前 ' . $current_drops . ' Drops'); $this->info($user->name . ', 当前余额: ' . $user->balance . ' 元'); $this->info('添加后 ' . $current_drops + $amount . ' Drops'); if (!$this->confirm('确认添加 ' . $amount . ' Drops?')) { $this->info('已取消。'); return 0; } $transaction->increaseDrops($user->id, $amount, '管理员添加 Drops', 'console'); $this->info('添加成功。'); return CommandAlias::SUCCESS; } }