+ Fix historic bugs

This commit is contained in:
Djery-Tom 2020-06-24 09:09:45 +01:00
parent 8fa08fd251
commit 0022e5451f
2 changed files with 7 additions and 2 deletions

View File

@ -161,10 +161,12 @@ class iLinkTransactionController extends Controller
if ($hyperviseurPayeur->id == $hyperviseur->id) { //Si c'est le reseau payeur est aussi emetteur
$walletHyperviseur->balance_com += $transaction->part_reseau_payeur;
$reseauPayeur->balance_com += $transaction->part_reseau_emetteur;
$transaction->id_wallet_hyp_payeur = $walletHyperviseur->id;
} else {
$wallet_agent_hypPayeur = WalletAgent::where('agent_id', $hyperviseurPayeur->id)->firstOrFail();
$walletHyperviseurPayeur = Wallet::findOrFail($wallet_agent_hypPayeur->wallet_id);
$walletHyperviseurPayeur->balance_com += $transaction->part_reseau_payeur;
$transaction->id_wallet_hyp_payeur = $walletHyperviseurPayeur->id;
$walletHyperviseurPayeur->save();
}
$walletHyperviseur->save();
@ -561,7 +563,7 @@ class iLinkTransactionController extends Controller
END
END AS destinataire , wit.date , wit.id FROM wallet_ilink_transaction wit
INNER JOIN type_ilink_transaction tit ON wit.type = tit.id LEFT JOIN users u ON u.user_code = wit.id_destinataire WHERE wit.id_wallet_user = :id_wallet
ORDER BY wit.date DESC LIMIT 10;',['id_wallet', $id_wallet_user]);
ORDER BY wit.date DESC LIMIT 10;',['id_wallet'=>$id_wallet_user]);
return $this->successResponse($transactions);
}
@ -577,7 +579,7 @@ class iLinkTransactionController extends Controller
END
END AS destinataire , wit.date , wit.id FROM wallet_ilink_transaction wit
INNER JOIN type_ilink_transaction tit ON wit.type = tit.id LEFT JOIN users u ON u.user_code = wit.id_destinataire WHERE wit.id_wallet_ag = :id_wallet
ORDER BY wit.date DESC LIMIT 10;',['id_wallet', $id_wallet_agent]);
ORDER BY wit.date DESC LIMIT 10;',['id_wallet'=>$id_wallet_agent]);
return $this->successResponse($transactions);
}

View File

@ -49,6 +49,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int $id_wallet_ag
* @property int $id_wallet_sup
* @property int $id_wallet_hyp
* @property int $id_wallet_hyp_payeur
* @property int $canceled
* @property int $type
* @property Carbon $date
@ -87,6 +88,7 @@ class WalletIlinkTransaction extends Model
'id_wallet_ag' => 'int',
'id_wallet_sup' => 'int',
'id_wallet_hyp' => 'int',
'id_wallet_hyp_payeur' => 'int',
'canceled' => 'int',
'type' => 'int'
];
@ -134,6 +136,7 @@ class WalletIlinkTransaction extends Model
'id_wallet_ag',
'id_wallet_sup',
'id_wallet_hyp',
'id_wallet_hyp_payeur',
'canceled',
'type',
'date'