+ Add current user groups infos

This commit is contained in:
Djery-Tom 2020-08-18 15:58:27 +01:00
parent 9502c6a355
commit 89ffc033f5
3 changed files with 22 additions and 0 deletions

View File

@ -477,6 +477,20 @@ ug.date_creation , ug.createur , ug.sponsor1 , ug.sponsor2 , ug.sponsor3, ug.cou
}
public function myGroup($code_user)
{
$groupe = collect(DB::select('SELECT ug.code_groupe , ug.nom , ug.limite_credit , ug.nombre_validation, ug.actif, ug.nombre_utilisateurs,
ug.date_creation , ug.createur , ug.sponsor1 , ug.sponsor2 , ug.sponsor3, ug.country, ug.currency_code, ug.id_createur FROM infos_users_groups ug
INNER JOIN users u ON ug.id = u.group_id WHERE u.user_code = :code', ['code' => $code_user]))->first();
if ($groupe)
return $this->successResponse($groupe);
else
return $this->errorResponse(trans('errors.not_belongs_to_any_group'));
}
private function checkSponsorIdentification($code_sponsor, $id, $init_country)
{
$sponsor = User::where('user_code', $code_sponsor)->first();

View File

@ -201,4 +201,11 @@ Request Information:
NB: The reimbursement process is automatic on the due date if the reimbursement is not initiated",
'successful_guarantee_nano_credit_demand' => 'Guaranteed nanocredit request',
'successful_nano_credit_refunded' => 'Nano credit repayment made',
'successful_nano_credit_demand_refunded' => "Nano credit refunded
Request Information:
- Request number: :id_demand
- Type of deposit: :deposit
- Credit amount: :amount
- Fees: :fees
- Net amount received: :net",
];

View File

@ -75,6 +75,7 @@ $router->group(['prefix' => '/groups'], function () use ($router) {
$router->put('', 'UserGroupController@updateGroup');
$router->post('join', 'UserGroupController@joinGroup');
$router->delete('', 'UserGroupController@deleteGroup');
$router->get('my/{code_user}', 'UserGroupController@myGroup');
// Demandes de validation
$router->group(['prefix' => '/demands'], function () use ($router) {