+ Fix bug on nano credits history
This commit is contained in:
parent
580ba27c7a
commit
dd340da9b4
|
@ -190,8 +190,8 @@ class NanoCreditController extends Controller
|
|||
// Demandes de nano credit et d'epargnes
|
||||
public function getAllNanoCreditsDemands($id_user, Request $request)
|
||||
{
|
||||
$demandes = DB::select("SELECT 'N' as type_historique , i.* FROM infos_users_demandes_credits i WHERE id_user = :id ;", ['id' => $id_user]);
|
||||
$savings = DB::select("SELECT 'E' as type_historique , i.* FROM infos_users_epargnes i WHERE id_user = :id;", ['id' => $id_user]);
|
||||
$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]);
|
||||
$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]);
|
||||
|
||||
// Supprimer les underscore sur les etats
|
||||
$merge = array_map(function ($demand) {
|
||||
|
@ -208,7 +208,7 @@ class NanoCreditController extends Controller
|
|||
|
||||
public function getNanoCreditsDemands($id_user)
|
||||
{
|
||||
$demandes = DB::select('SELECT * FROM infos_users_demandes_credits WHERE id_user = :id ORDER BY date_creation DESC;', ['id' => $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]);
|
||||
|
||||
$result = array_map(function ($demand) {
|
||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||
|
@ -220,7 +220,7 @@ class NanoCreditController extends Controller
|
|||
// Demandes de credits en cours pour le remboursement
|
||||
public function getNanoCreditsDemandsInProgress($id_user)
|
||||
{
|
||||
$demandes = DB::select("SELECT * FROM infos_users_demandes_credits WHERE id_user = :id AND etat = 'VALIDE' ORDER BY date_creation DESC;", ['id' => $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]);
|
||||
$result = array_map(function ($demand) {
|
||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||
return $demand;
|
||||
|
@ -230,7 +230,7 @@ class NanoCreditController extends Controller
|
|||
|
||||
public function getGuaranteeNanoCreditsDemands($id_wallet_agent)
|
||||
{
|
||||
$demandes = DB::select('SELECT * FROM infos_users_demandes_credits WHERE id_wallet_agent = :id ORDER BY date_creation DESC;'
|
||||
$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;'
|
||||
, ['id' => $id_wallet_agent]);
|
||||
$result = array_map(function ($demand) {
|
||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||
|
@ -241,7 +241,7 @@ class NanoCreditController extends Controller
|
|||
|
||||
public function getSavingsDemands($id_user)
|
||||
{
|
||||
$savings = DB::select('SELECT * FROM infos_users_epargnes WHERE id_user = :id ORDER BY date_creation DESC;', ['id' => $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]);
|
||||
$result = array_map(function ($demand) {
|
||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||
return $demand;
|
||||
|
@ -252,7 +252,7 @@ class NanoCreditController extends Controller
|
|||
// Demandes d'epargnes pour la cassation
|
||||
public function getSavingsDemandsInProgress($id_user)
|
||||
{
|
||||
$savings = DB::select("SELECT * FROM infos_users_epargnes WHERE id_user = :id AND etat = 'EN_COURS' ORDER BY date_creation DESC;", ['id' => $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]);
|
||||
$result = array_map(function ($demand) {
|
||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
||||
return $demand;
|
||||
|
|
Loading…
Reference in New Issue