+ Fix bug

This commit is contained in:
Djery-Tom 2020-08-25 06:18:14 +01:00
parent eae06f9132
commit 5015476aef
1 changed files with 6 additions and 4 deletions

View File

@ -390,12 +390,14 @@ class UserGroupController extends Controller
public function getGroupDemand($id_demand) public function getGroupDemand($id_demand)
{ {
$demand = collect(DB::select('SELECT ugd.* , ug.code_groupe , ug.nom , ug.limite_credit , ug.nombre_validation, ug.actif, ug.nombre_utilisateurs, $demand = collect(DB::select('SELECT ugd.* , ugd.date_creation as date_creation_demande , 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 FROM users_groups_demandes_validations ugd ug.date_creation as date_creation_groupe , ug.createur , ug.sponsor1 , ug.sponsor2 , ug.sponsor3, ug.country, ug.currency_code FROM users_groups_demandes_validations ugd
INNER JOIN infos_users_groups ug ON ug.id = ugd.id_group WHERE ugd.id = :id;', ['id' => $id_demand]))->first(); INNER JOIN infos_users_groups ug ON ug.id = ugd.id_group WHERE ugd.id = :id;', ['id' => $id_demand]))->first();
if ($demand) if ($demand) {
unset($demand->date_creation);
return $this->successResponse($demand); return $this->successResponse($demand);
else
} else
return $this->errorResponse(trans('errors.model_not_found', ['model' => 'groupValidationDemand']), Response::HTTP_BAD_REQUEST); return $this->errorResponse(trans('errors.model_not_found', ['model' => 'groupValidationDemand']), Response::HTTP_BAD_REQUEST);
} }