Add Nano Health , password_validation in response payload when show agent wallet

This commit is contained in:
Djery-Tom 2022-03-28 14:13:41 +01:00
parent 1c84cde0ea
commit d9c85a7814
1 changed files with 7 additions and 2 deletions

View File

@ -83,9 +83,14 @@ class WalletController extends Controller
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 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();
if ($wallet)
if ($wallet) {
// Recuperer la config du nano santé
$nhConfig = collect(DB::select('SELECT * FROM nh_networks_configs WHERE network_id = :network_id LIMIT 50', ['network_id' => $wallet->id_network]))->first();
if (isset($nhConfig)) {
$wallet->password_validation = $nhConfig->password_validation ?? "MAX";
}
return $this->successResponse($wallet);
else
} else
return $this->errorResponse(trans('errors.model_not_found', ['model' => 'wallet']), Response::HTTP_BAD_REQUEST);
}