@@ -72,28 +72,28 @@ |
||
| 72 | 72 | * |
| 73 | 73 | * @return mixed |
| 74 | 74 | */ |
| 75 | - public function handle() |
|
| 76 | - { |
|
| 77 | - $categories = Category::get(); |
|
| 75 | + public function handle() |
|
| 76 | + { |
|
| 77 | + $categories = Category::get(); |
|
| 78 | 78 | |
| 79 | - if ($categories->isEmpty()) { |
|
| 80 | - $this->info("No categories to export"); |
|
| 81 | - return; |
|
| 82 | - } |
|
| 79 | + if ($categories->isEmpty()) { |
|
| 80 | + $this->info("No categories to export"); |
|
| 81 | + return; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - foreach ($categories as $category){ |
|
| 85 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 84 | + foreach ($categories as $category){ |
|
| 85 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 86 | 86 | ->where('category_id', $category->id) |
| 87 | 87 | ->orderBy('netlogin', 'desc') |
| 88 | 88 | ->get(); |
| 89 | 89 | |
| 90 | - $name = static::stringNormalise($category->name); |
|
| 91 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 90 | + $name = static::stringNormalise($category->name); |
|
| 91 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 92 | 92 | |
| 93 | - $count = $this->exportAccount($accounts, $filename, false, $this->option('ci')); |
|
| 93 | + $count = $this->exportAccount($accounts, $filename, false, $this->option('ci')); |
|
| 94 | 94 | |
| 95 | - $url = $this->storage->path($filename); |
|
| 96 | - $this->info("{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
| 97 | - } |
|
| 98 | - } |
|
| 95 | + $url = $this->storage->path($filename); |
|
| 96 | + $this->info("{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | 99 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $count = count($accounts); |
| 12 | 12 | |
| 13 | 13 | if ($flagCI === false) { |
| 14 | - $bar = $this->output->createProgressBar($count); |
|
| 14 | + $bar = $this->output->createProgressBar($count); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | foreach ($accounts as $account) { |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | $record .= $password ? ":{$account->netpass}" : ''; |
| 20 | 20 | $this->storage->prepend($filename, $record); |
| 21 | 21 | if (isset($bar)) { |
| 22 | - $bar->advance(); |
|
| 22 | + $bar->advance(); |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | if (isset($bar)) { |
| 27 | - $bar->finish(); |
|
| 28 | - $this->info("\n"); |
|
| 27 | + $bar->finish(); |
|
| 28 | + $this->info("\n"); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | return $count; |
@@ -72,28 +72,28 @@ |
||
| 72 | 72 | * |
| 73 | 73 | * @return mixed |
| 74 | 74 | */ |
| 75 | - public function handle() |
|
| 76 | - { |
|
| 77 | - $groups = Group::get(); |
|
| 75 | + public function handle() |
|
| 76 | + { |
|
| 77 | + $groups = Group::get(); |
|
| 78 | 78 | |
| 79 | - if ($groups->isEmpty()) { |
|
| 80 | - $this->info("No groups to export"); |
|
| 81 | - return; |
|
| 82 | - } |
|
| 79 | + if ($groups->isEmpty()) { |
|
| 80 | + $this->info("No groups to export"); |
|
| 81 | + return; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - foreach ($groups as $group){ |
|
| 85 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 84 | + foreach ($groups as $group){ |
|
| 85 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 86 | 86 | ->where('group_id', $group->id) |
| 87 | 87 | ->orderBy('netlogin', 'desc') |
| 88 | 88 | ->get(); |
| 89 | 89 | |
| 90 | - $name = static::stringNormalise($group->name); |
|
| 91 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 90 | + $name = static::stringNormalise($group->name); |
|
| 91 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 92 | 92 | |
| 93 | - $count = $this->exportAccount($accounts, $filename, false, $this->option('ci')); |
|
| 93 | + $count = $this->exportAccount($accounts, $filename, false, $this->option('ci')); |
|
| 94 | 94 | |
| 95 | - $url = $this->storage->path($filename); |
|
| 96 | - $this->info("{$count} accounts '{$group->name}' exported into file '{$url}'"); |
|
| 97 | - } |
|
| 98 | - } |
|
| 95 | + $url = $this->storage->path($filename); |
|
| 96 | + $this->info("{$count} accounts '{$group->name}' exported into file '{$url}'"); |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | 99 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | public function handle() |
| 82 | 82 | { |
| 83 | 83 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
| 84 | - ->orderBy('netlogin', 'desc')->get(); |
|
| 84 | + ->orderBy('netlogin', 'desc')->get(); |
|
| 85 | 85 | |
| 86 | 86 | if ($accounts->isEmpty() && !$this->option('empty')) { |
| 87 | 87 | $this->info("No accounts to export"); |