Skip to content

Commit

Permalink
BUGFIX SIO-3607 filter by model servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Korsakov committed Sep 22, 2021
1 parent 3797255 commit 49bc9a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/Database/Models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace WHMCS\Module\Server\SolusIoVps\Database\Models;

use WHMCS\Module\Server\SolusIoVps\WhmcsAPI\Product;
use WHMCS\Database\Capsule as DB;

/**
Expand All @@ -28,9 +29,9 @@ public static function getParams(int $serverId): array
];
}

public static function getServerIds(): array
public static function getModuleServers(): array
{
$result = DB::table(self::TABLE)->pluck('id');
$result = DB::table(self::TABLE)->whereType(Product::MODULE_NAME)->pluck('id');

return collect($result)->all();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/WhmcsAPI/Servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Servers
{
public static function getValidParams(): array
{
$serverIds = Server::getServerIds();
$serverIds = Server::getModuleServers();

foreach ($serverIds as $serverId) {
$serverParams = Server::getParams($serverId);
Expand Down

0 comments on commit 49bc9a9

Please sign in to comment.