diff --git a/app/api/apiclient.php b/app/api/apiclient.php index ed38141..2e57b59 100644 --- a/app/api/apiclient.php +++ b/app/api/apiclient.php @@ -2,7 +2,7 @@ function api_client_kuri($hash){ - $sql = "SELECT client_id FROM `clients` WHERE `clienthash` = '$hash' LIMIT 1 "; + $sql = "SELECT client_id, clientgroup_id FROM `clients` WHERE `clienthash` = '$hash' LIMIT 1 "; $client = db_get($sql); if (isset($client['client_id'])) @@ -32,7 +32,11 @@ function api_login($login, $password){ } -function clientbuys_kuri($client_id, $page = 1){ +function clientbuys_kuri($client_id, $page = 1, $group_id = null){ + + if ($group_id == 1 or $group_id == 2){ + return clients_arch($page); + } $sql_sub = "SELECT number_id FROM anbuy WHERE client_id = '$client_id' AND `number_id` = 486 AND `buy_status` = '1' LIMIT 1"; //есть ли активная подписка $findsub = db_get($sql_sub); diff --git a/app/routes/client.php b/app/routes/client.php index c23b833..579cead 100644 --- a/app/routes/client.php +++ b/app/routes/client.php @@ -99,7 +99,7 @@ function mybooks_kuri($page = 1){ return; } - $items = clientbuys_kuri($client['client_id'], $page); + $items = clientbuys_kuri($client['client_id'], $page, $client['clientgroup_id']); $count = $items['count']; if ($count > $limit){