public function Gz_nameValidate()
 {
     $gz_name = Input::get('gz_name');
     $ZwController = new ZwController();
     $jsonData = $ZwController->getZwByGz_name($gz_name);
     $arr = json_decode($jsonData, true);
     //return $jsonData;
     if ($arr['result']) {
         return 'false';
     } else {
         return 'true';
     }
 }
Пример #2
0
 public function getByNameStats()
 {
     $name = Input::get('name');
     $stats = Input::get('stats');
     try {
         if ($stats == 0) {
             $ygdangan = Ygdangan::where('name', 'like', '%' . $name . '%')->get();
         } else {
             $ygdangan = Ygdangan::where('stats', $stats)->get();
         }
         $ZwController = new ZwController();
         for ($i = 0; $i < count($ygdangan); $i++) {
             $zw = $ZwController->getZwByGz_id($ygdangan[$i]['gzname']);
             $arr = json_decode($zw, true);
             if (count($arr['zw']) > 0) {
                 $ygdangan[$i]['bmname'] = $arr['zw'][0]['bm_name'];
                 $ygdangan[$i]['gzname'] = $arr['zw'][0]['gz_name'];
             } else {
                 $ygdangan[$i]['bmname'] = '';
                 $ygdangan[$i]['gzname'] = '';
             }
         }
         return json_encode(array('result' => true, 'ygdangan' => $ygdangan));
     } catch (Exception $e) {
         return json_encode(array('result' => false, 'message' => $e));
     }
 }