+ Add pagination to hyper and super history's routes

This commit is contained in:
Djery-Tom 2020-10-07 10:07:11 +01:00
parent 3b330e1595
commit 001d44eb69
3 changed files with 6 additions and 7 deletions

View File

@ -201,7 +201,9 @@ class NanoCreditController extends Controller
usort($merge, array($this, 'sortFunction')); // Trier le tout par date usort($merge, array($this, 'sortFunction')); // Trier le tout par date
return $this->successResponse($this->arrayPaginator($merge, $request)); // return $this->successResponse($this->arrayPaginator($merge, $request));
return $this->successResponse($merge);
} }
public function getNanoCreditsDemands($id_user) public function getNanoCreditsDemands($id_user)

View File

@ -161,9 +161,7 @@ class WalletController extends Controller
usort($result, array($this, 'sortFunction')); // Trier le tout par date usort($result, array($this, 'sortFunction')); // Trier le tout par date
// return $this->successResponse($this->arrayPaginator($result,$request)); return $this->successResponse($this->arrayPaginator($result, $request));
return $this->successResponse($result);
} }
public function superHistory($id_wallet, Request $request) public function superHistory($id_wallet, Request $request)
@ -213,8 +211,7 @@ class WalletController extends Controller
usort($result, array($this, 'sortFunction')); // Trier le tout par date usort($result, array($this, 'sortFunction')); // Trier le tout par date
// return $this->successResponse($this->arrayPaginator($result,$request)); return $this->successResponse($this->arrayPaginator($result, $request));
return $this->successResponse($result);
} }
} }

View File

@ -1435,7 +1435,7 @@ class iLinkTransactionController extends Controller
$weekly_sum = WalletIlinkTransaction::where('id_document_emetteur', $identifiant)->where('final_country', $final_country)->whereBetween('date', [Carbon::today()->subDay(7), Carbon::today()])->sum('montant'); $weekly_sum = WalletIlinkTransaction::where('id_document_emetteur', $identifiant)->where('final_country', $final_country)->whereBetween('date', [Carbon::today()->subDay(7), Carbon::today()])->sum('montant');
else else
$weekly_sum = WalletIlinkTransaction::where('id_wallet_user', $identifiant)->where('final_country', $final_country)->whereBetween('date', [Carbon::today()->subDay(7), Carbon::today()])->sum('montant'); $weekly_sum = WalletIlinkTransaction::where('id_wallet_user', $identifiant)->where('final_country', $final_country)->whereBetween('date', [Carbon::today()->subDay(7), Carbon::today()])->sum('montant');
$max_hebdo = ($init_country == $final_country) ? $regulation->montant_max_hedbo_national : $regulation->montant_max_hedbo_international; $max_hebdo = ($init_country == $final_country) ? $regulation->montant_max_hebdo_national : $regulation->montant_max_hebdo_international;
$amount_admitted = $max_hebdo - $weekly_sum; $amount_admitted = $max_hebdo - $weekly_sum;
if (($weekly_sum + $montant_transaction) > $max_hebdo) if (($weekly_sum + $montant_transaction) > $max_hebdo)
return $this->errorResponse(($init_country == $final_country) ? trans('errors.national_weekly_regulations_limits_reached') : trans('errors.international_weekly_regulations_limits_reached') . ' ' return $this->errorResponse(($init_country == $final_country) ? trans('errors.national_weekly_regulations_limits_reached') : trans('errors.international_weekly_regulations_limits_reached') . ' '