+ Fix bug on nano credits history v2
This commit is contained in:
parent
dd340da9b4
commit
7ea42263f3
|
@ -190,8 +190,8 @@ class NanoCreditController extends Controller
|
||||||
// Demandes de nano credit et d'epargnes
|
// Demandes de nano credit et d'epargnes
|
||||||
public function getAllNanoCreditsDemands($id_user, Request $request)
|
public function getAllNanoCreditsDemands($id_user, Request $request)
|
||||||
{
|
{
|
||||||
$demandes = DB::select("SELECT 'N' as type_historique , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE id_user = :id ;", ['id' => $id_user]);
|
$demandes = DB::select("SELECT 'N' as type_historique , i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE id_user = :id ;", ['id' => $id_user]);
|
||||||
$savings = DB::select("SELECT 'E' as type_historique ,i.user as destinataire, i.* FROM infos_users_epargnes i WHERE id_user = :id;", ['id' => $id_user]);
|
$savings = DB::select("SELECT 'E' as type_historique , i.montant , i.user as destinataire, i.* FROM infos_users_epargnes i WHERE id_user = :id;", ['id' => $id_user]);
|
||||||
|
|
||||||
// Supprimer les underscore sur les etats
|
// Supprimer les underscore sur les etats
|
||||||
$merge = array_map(function ($demand) {
|
$merge = array_map(function ($demand) {
|
||||||
|
@ -208,7 +208,7 @@ class NanoCreditController extends Controller
|
||||||
|
|
||||||
public function getNanoCreditsDemands($id_user)
|
public function getNanoCreditsDemands($id_user)
|
||||||
{
|
{
|
||||||
$demandes = DB::select('SELECT i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
$demandes = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
||||||
|
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||||
|
@ -220,7 +220,7 @@ class NanoCreditController extends Controller
|
||||||
// Demandes de credits en cours pour le remboursement
|
// Demandes de credits en cours pour le remboursement
|
||||||
public function getNanoCreditsDemandsInProgress($id_user)
|
public function getNanoCreditsDemandsInProgress($id_user)
|
||||||
{
|
{
|
||||||
$demandes = DB::select("SELECT i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_user = :id AND i.etat = 'VALIDE' ORDER BY date_creation DESC;", ['id' => $id_user]);
|
$demandes = DB::select("SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_user = :id AND i.etat = 'VALIDE' ORDER BY date_creation DESC;", ['id' => $id_user]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||||
return $demand;
|
return $demand;
|
||||||
|
@ -230,7 +230,7 @@ class NanoCreditController extends Controller
|
||||||
|
|
||||||
public function getGuaranteeNanoCreditsDemands($id_wallet_agent)
|
public function getGuaranteeNanoCreditsDemands($id_wallet_agent)
|
||||||
{
|
{
|
||||||
$demandes = DB::select('SELECT i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_wallet_agent = :id ORDER BY i.date_creation DESC;'
|
$demandes = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_wallet_agent = :id ORDER BY i.date_creation DESC;'
|
||||||
, ['id' => $id_wallet_agent]);
|
, ['id' => $id_wallet_agent]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||||
|
@ -241,7 +241,7 @@ class NanoCreditController extends Controller
|
||||||
|
|
||||||
public function getSavingsDemands($id_user)
|
public function getSavingsDemands($id_user)
|
||||||
{
|
{
|
||||||
$savings = DB::select('SELECT i.user as destinataire, i.* FROM infos_users_epargnes i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
$savings = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_epargnes i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||||
return $demand;
|
return $demand;
|
||||||
|
@ -252,7 +252,7 @@ class NanoCreditController extends Controller
|
||||||
// Demandes d'epargnes pour la cassation
|
// Demandes d'epargnes pour la cassation
|
||||||
public function getSavingsDemandsInProgress($id_user)
|
public function getSavingsDemandsInProgress($id_user)
|
||||||
{
|
{
|
||||||
$savings = DB::select("SELECT i.user as destinataire, i.* FROM infos_users_epargnes i WHERE i.id_user = :id AND i.etat = 'EN_COURS' ORDER BY i.date_creation DESC;", ['id' => $id_user]);
|
$savings = DB::select("SELECT i.montant , i.user as destinataire, i.* FROM infos_users_epargnes i WHERE i.id_user = :id AND i.etat = 'EN_COURS' ORDER BY i.date_creation DESC;", ['id' => $id_user]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||||
return $demand;
|
return $demand;
|
||||||
|
|
|
@ -119,8 +119,8 @@ class WalletController extends Controller
|
||||||
public function hyperHistory($id_network, Request $request)
|
public function hyperHistory($id_network, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$demandes = DB::select("SELECT 'N' as type_historique, i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE id_network = :id ;", ['id' => $id_network]);
|
$demandes = DB::select("SELECT 'N' as type_historique, i.montant , i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE id_network = :id ;", ['id' => $id_network]);
|
||||||
$savings = DB::select("SELECT 'E' as type_historique , i.* FROM infos_users_epargnes i WHERE id_network = :id;", ['id' => $id_network]);
|
$savings = DB::select("SELECT 'E' as type_historique , i.montant , i.user as destinataire , i.* FROM infos_users_epargnes i WHERE id_network = :id;", ['id' => $id_network]);
|
||||||
|
|
||||||
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
||||||
wit.nom_destinataire, wit.prenom_destinataire, wit.type , wit.id_wallet_user, wit.init_country, wit.final_country , wit.network_destinataire , wit.montant_net_final_country ,
|
wit.nom_destinataire, wit.prenom_destinataire, wit.type , wit.id_wallet_user, wit.init_country, wit.final_country , wit.network_destinataire , wit.montant_net_final_country ,
|
||||||
|
@ -175,7 +175,7 @@ class WalletController extends Controller
|
||||||
|
|
||||||
$walletSup = WalletAgent::where('wallet_id', $id_wallet)->firstOrFail();
|
$walletSup = WalletAgent::where('wallet_id', $id_wallet)->firstOrFail();
|
||||||
|
|
||||||
$demandes = DB::select("SELECT 'N' as type_historique , i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
$demandes = DB::select("SELECT 'N' as type_historique , i.montant ,i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
||||||
|
|
||||||
|
|
||||||
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
||||||
|
@ -229,7 +229,8 @@ class WalletController extends Controller
|
||||||
public function allHyperHistory($id_network)
|
public function allHyperHistory($id_network)
|
||||||
{
|
{
|
||||||
|
|
||||||
$savings = DB::select("SELECT 'E' as type_historique , i.user as destinataire , i.* FROM infos_users_epargnes i WHERE id_network = :id;", ['id' => $id_network]);
|
$demandes = DB::select("SELECT 'N' as type_historique, i.montant , i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE id_network = :id ;", ['id' => $id_network]);
|
||||||
|
$savings = DB::select("SELECT 'E' as type_historique , i.montant , i.user as destinataire , i.* FROM infos_users_epargnes i WHERE id_network = :id;", ['id' => $id_network]);
|
||||||
|
|
||||||
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
||||||
wit.nom_destinataire, wit.prenom_destinataire, wit.type , wit.id_wallet_user, wit.init_country, wit.final_country , wit.network_destinataire , wit.montant_net_final_country ,
|
wit.nom_destinataire, wit.prenom_destinataire, wit.type , wit.id_wallet_user, wit.init_country, wit.final_country , wit.network_destinataire , wit.montant_net_final_country ,
|
||||||
|
@ -283,7 +284,7 @@ class WalletController extends Controller
|
||||||
|
|
||||||
$walletSup = WalletAgent::where('wallet_id', $id_wallet)->firstOrFail();
|
$walletSup = WalletAgent::where('wallet_id', $id_wallet)->firstOrFail();
|
||||||
|
|
||||||
$demandes = DB::select("SELECT 'N' as type_historique, i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
$demandes = DB::select("SELECT 'N' as type_historique, i.montant , i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
||||||
|
|
||||||
|
|
||||||
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
$transactions = DB::select("SELECT 'T' as type_historique, wit.id_transaction, tit.nom as operation , wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
||||||
|
|
Loading…
Reference in New Issue