Fix bugs when fetch group and operators

This commit is contained in:
Djery-Tom 2022-02-22 11:27:00 +01:00
parent 8423c6d29c
commit b2364952a7
2 changed files with 6 additions and 6 deletions

View File

@ -644,7 +644,7 @@ ug.date_creation , ug.createur , ug.sponsor1 , ug.sponsor2 , ug.sponsor3, ug.cou
} }
} }
private function checkUserIdentification($id_user, $id) public function checkUserIdentification($id_user, $id)
{ {
$identification = Identification::where('id_user', $id_user)->first(); $identification = Identification::where('id_user', $id_user)->first();
if (isset($identification)) { if (isset($identification)) {

View File

@ -365,13 +365,13 @@ class WalletController extends Controller
/** /**
* @OA\Get( * @OA\Get(
* path="/wallets/users/operators/{type_operator}/{id_wallet_network}", * path="/wallets/users/operators/{type}/{id_wallet_network}",
* summary="Afficher la liste des opérateurs d'un reseau", * summary="Afficher la liste des opérateurs d'un reseau",
* tags={"Liste des opérateurs d'un reseau"}, * tags={"Liste des opérateurs d'un reseau"},
* security={{"api_key":{}}}, * security={{"api_key":{}}},
* @OA\Parameter( * @OA\Parameter(
* parameter="type_operator", * parameter="type",
* name="type_operator", * name="type",
* description="Type d'operateur", * description="Type d'operateur",
* in="path", * in="path",
* required=true, * required=true,
@ -411,10 +411,10 @@ class WalletController extends Controller
* ) * )
*/ */
public function getWalletOperators($id_wallet_network, $type_operator) public function getWalletOperators($type, $id_wallet_network)
{ {
$operators = DB::select("SELECT oc.id as id_operator, o.nom as operator_name , oc.adresse as operator_address, c.name as country FROM networks_operators nop INNER JOIN operators_countries oc ON oc.id = nop.id_operator_country INNER JOIN operators o ON o.id = oc.id_operator $operators = DB::select("SELECT oc.id as id_operator, o.nom as operator_name , oc.adresse as operator_address, c.name as country FROM networks_operators nop INNER JOIN operators_countries oc ON oc.id = nop.id_operator_country INNER JOIN operators o ON o.id = oc.id_operator
INNER JOIN countries c ON oc.id_country = c.id INNER JOIN type_operators top ON o.type = top.code WHERE nop.id_network = :id_network AND o.type = :type_operator ;", ['id_network' => $id_wallet_network, 'type_operator' => $type_operator]); INNER JOIN countries c ON oc.id_country = c.id INNER JOIN type_operators top ON o.type = top.code WHERE nop.id_network = :id_network AND o.type = :type_operator ;", ['id_network' => $id_wallet_network, 'type_operator' => $type]);
return $this->successResponse($operators); return $this->successResponse($operators);
} }