diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index a2bfe28..21c7c4e 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -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); } diff --git a/app/Models/WalletIlinkTransaction.php b/app/Models/WalletIlinkTransaction.php index 6205361..ea86191 100644 --- a/app/Models/WalletIlinkTransaction.php +++ b/app/Models/WalletIlinkTransaction.php @@ -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'