+ Update user wallet fields

This commit is contained in:
Djery-Tom 2020-06-02 09:35:37 +01:00
parent ed46eaa5dd
commit 8a5487e5ac
1 changed files with 7 additions and 2 deletions

View File

@ -98,8 +98,13 @@ class WalletController extends Controller
// Wallets users iLink
public function showWalletUser($id_user){
$wallet = WalletsUser::where('idUser',$id_user)->firstOrFail();
$wallet = collect(DB::select('SELECT wu.* , c.name as country , i.user_code , n.name as network from wallets_users wu
INNER JOIN identifications i ON i.idUser = wu.idUser INNER JOIN countries c ON i.country = c.id INNER JOIN networks n ON i.idNetwork = n.id
WHERE wu.idUser = :idUser',['idUser' => $id_user]))->first();
if($wallet)
return $this->successResponse($wallet);
else
return $this->errorResponse(trans('errors.model_not_found',['model'=>'wallet']),Response::HTTP_BAD_REQUEST);
}
}