Update wallets response payload

This commit is contained in:
Djery-Tom 2022-02-15 16:31:08 +01:00
parent cb43bc2e13
commit 9e5e93401d
1 changed files with 4 additions and 4 deletions

View File

@ -56,11 +56,11 @@ class WalletController extends Controller
// Return only single wallet if it is hypervisor or supervisor // Return only single wallet if it is hypervisor or supervisor
if (in_array($category, ['hyper', 'super'])) { if (in_array($category, ['hyper', 'super'])) {
// Remove unnecessary fields // Remove unnecessary fields
$networks = $this->array_except($networks, ['category']); // $networks = $this->array_except($networks, ['category']);
return $this->successResponse(collect($networks)->first()); return $this->successResponse(collect($networks)->first());
} else { } else {
// Remove unnecessary fields // Remove unnecessary fields
$networks = $this->array_except($networks, ['category', 'balance_princ', 'balance_com', 'created_date', 'taux_com_client_depot']); $networks = $this->array_except($networks, ['balance_princ', 'balance_com', 'created_date', 'taux_com_client_depot']);
return $this->successResponse($networks); return $this->successResponse($networks);
} }
@ -80,8 +80,8 @@ class WalletController extends Controller
{ {
// $wallet = Wallet::findOrFail($id_wallet); // $wallet = Wallet::findOrFail($id_wallet);
$wallet = collect(DB::select('SELECT wa.wallet_id AS id, wa.balance_princ, wa.balance_com, wa.created_date, wa.network , cw.taux_com_client_depot, c.name AS country, cw.type, wa.networks_agent_id as network_agent_id, $wallet = collect(DB::select('SELECT wa.wallet_id AS id, wa.balance_princ, wa.balance_com, wa.created_date, wa.network , cw.taux_com_client_depot, c.name AS country, cw.type, wa.networks_agent_id as network_agent_id,
c.currency_code , cw.id_network , cw.has_nano_credit FROM wallet_agent wa INNER JOIN configWallet cw ON wa.network_id = cw.id_network INNER JOIN networks n ON n.id = wa.network_id c.currency_code , cw.id_network , cw.has_nano_credit , cG.category FROM wallet_agent wa INNER JOIN configWallet cw ON wa.network_id = cw.id_network INNER JOIN networks n ON n.id = wa.network_id
INNER JOIN countries_currencies c ON c.id = n.country_id INNER JOIN countries_currencies c ON c.id = n.country_id INNER JOIN networks_agents na on na.id = wa.networks_agent_id INNER JOIN codeGenerer cG on na.codeGenerer_id = cG.id
WHERE wa.wallet_id = :id', ['id' => $id_wallet]))->first(); WHERE wa.wallet_id = :id', ['id' => $id_wallet]))->first();
if ($wallet) if ($wallet)
return $this->successResponse($wallet); return $this->successResponse($wallet);