mercredi 6 janvier 2021

I want to get 2 tables from mysql and check 2 object but I couldn't count it how can I do could you help for me?

public function matchOrNot() { $belediyeprofils = DB::table('belediye_profil')->join('envanter_genel', 'envanter_genel.belediye_id', '=', 'belediye_profil.id')->where('envanter_genel.status', 8)->get(); // $envantergenels = DB::table('envanter_genel')->join('belediye_profil', 'envanter_genel.belediye_id', '=', 'belediye_profil.id')->get();

    $i=0;

    
    foreach ($belediyeprofils as $belediyeprofil) 
    if($i<100)
    {
    {
       
            $q = $belediyeprofil->name;
            $w = $belediyeprofil->ilce;
            $s = $belediyeprofil->id; 
            
    }
    if(strpos($q, $w)!== false)
    {
            return $s ; //Matched
    }
            else
    {
            $returnData = //notMatched
            [
                
                    'Sayaç' => $i,
                    'Id' => $s,
                    'Belediye' => $q,
                    'İlçe' => $w,
                    
                  
            ];  
            return response()->json($returnData, 200);;
    }           
    }
    
            $i++;
            $s++;
                

}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35dJXar
via IFTTT

Aucun commentaire:

Enregistrer un commentaire