public function getListByRegionIds($county_id, $town_id, $pdo) { $list = array(); if ($town_id) { $village = new G3dVillageTable(); $list = $village->getGidsByTownId($town_id, $pdo); } else { if ($county_id) { $village = new G3dVillageTable(); $list = $village->getGidsByCountyId($county_id, $pdo); } } return $list; }
<?php require_once 'lib/G3dDatabase.php'; require_once 'lib/G3dIO.php'; require_once 'lib/G3dVillageTable.php'; $conf_file_path = $_SERVER['DOCUMENT_ROOT'] . '/../gis3d.conf'; $io = new G3dIO(); $db = new G3dDatabase(); $db->setupDatabaseByConfFile($conf_file_path); $village = new G3dVillageTable(); $db->connect(); $set = $io->get('get', 'set'); $id = $io->get('get', 'id'); $fineness = $io->get('get', 'fineness'); if (NULL == $set) { if (NULL != $id) { if (32 == $fineness) { $data = $village->getModel3d32ById($id, $db->pdo); if (NULL == $data[0]->model) { $data = $village->getGeomById($id, $fineness, $db->pdo); } } else { $data = $village->getGeomById($id, $fineness, $db->pdo); } } else { $data = $village->getCentroids($db->pdo); } } else { if (32 == $fineness) { $model_string = json_encode($io->get('post', 'model')); $data = $village->updateModel3d32ById($id, $model_string, $db->pdo);
$conf_file_path = $_SERVER['DOCUMENT_ROOT'] . '/../gis3d.conf'; $io = new G3dIO(); $db = new G3dDatabase(); $db->setupDatabaseByConfFile($conf_file_path); $wrap = new G3dWrapTable(); $db->connect(); $order = $io->get('postOrGet', 'order'); switch ($order) { case 'update': $id = $io->get('postOrGet', 'wrapId'); $gId = $io->get('postOrGet', 'gId'); $county = $io->get('postOrGet', 'county'); $town = $io->get('postOrGet', 'town'); $village = $io->get('postOrGet', 'village'); $data = $io->get('postOrGet', 'data'); $villageTable = new G3dVillageTable(); $id = $wrap->getWrapById($id, $db->pdo)->wrap_id; $village_gid = $villageTable->getVillageByGid($gId, $db->pdo); if ($id && null != $data) { if (!$village_gid && $county && $town && $village) { $village_gid = $villageTable->getGidByNames($county, $town, $village, $db->pdo); } if ($village_gid) { $dataTable = new G3dDataTable(); $dataTable->setDataByIds($id, $village_gid, $data, $db->pdo); $wrap->renewUpdatedTimeById($id, $db->pdo); } } break; case 'get': default: