+ Fix bug when create supervisor and assign network
This commit is contained in:
parent
27eab01ae3
commit
959956ce26
|
@ -277,8 +277,9 @@ na.validation_code as validation_code,ag.id as agentId,na.solde AS balance,na.et
|
|||
if($membre['category']=='super'){
|
||||
$phone=$membre["phone"];
|
||||
$demandere=mysqli_query($this->con,"SELECT etat FROM demandeAdhesion WHERE phone='$phone'");
|
||||
if($demandere){
|
||||
$membre['etat_demande']=mysqli_fetch_array($demandere,MYSQLI_ASSOC)['etat'];
|
||||
if(isset($demandere)){
|
||||
$demand = mysqli_fetch_array($demandere,MYSQLI_ASSOC);
|
||||
$membre['etat_demande']= isset($demand) ? $demand['etat'] : 1;
|
||||
}
|
||||
}
|
||||
if($membre['category']!='geolocated'){
|
||||
|
|
|
@ -560,7 +560,7 @@ class Requester
|
|||
public function getChildCode($codeparrain)
|
||||
{
|
||||
$r=$this->db->getCategoryAgent($codeparrain);
|
||||
if($r['etat']==1){
|
||||
if(isset($r) and $r['etat']==1){
|
||||
switch ($r['category']){
|
||||
case 'hyper':
|
||||
$r['child']='super';
|
||||
|
@ -1033,7 +1033,7 @@ na.id as agent_id,ds.id,cg.code_membre as code_membre ,ds.id as demande_id FROM
|
|||
public function assignNetworkToAgent($agentId, $code_parrain, $phone)
|
||||
{
|
||||
$agent = $this->db->getAgentById($agentId);
|
||||
if ($agent) {
|
||||
if (isset($agent)) {
|
||||
$indicatif=$agent["indicatif"];
|
||||
if ($this->db->isPhoneExistedInCategory(null,null,$indicatif.$phone)) {
|
||||
$response["error"] = 1;
|
||||
|
@ -1041,7 +1041,7 @@ na.id as agent_id,ds.id,cg.code_membre as code_membre ,ds.id as demande_id FROM
|
|||
return json_encode($response);
|
||||
} else {
|
||||
$parrain=$this->getChildCode($code_parrain);
|
||||
if($parrain['child']==='geolocated'){
|
||||
if(isset($parrain) and $parrain['child']==='geolocated'){
|
||||
$user = $this->db->generateNetworkAgent($phone, $code_parrain,$agent);
|
||||
if (isset($user['success'])) {
|
||||
$result = $this->db->assignNetworkAgent($agentId, $user['id']);
|
||||
|
|
Loading…
Reference in New Issue