if(Context::get('document_srl')){
        $mapDocument = $oDocumentModel->getDocument(Context::get('document_srl'));
        if($mapDocument->getExtraEidValue($map_latitude_eid) && $mapDocument->getExtraEidValue($map_longitude_eid)){
          $map_obj = '';
          $map_obj->document_srl = Context::get('document_srl');
          $map_obj->map_latitude = $mapDocument->getExtraEidValue($map_latitude_eid);
          $map_obj->map_longitude = $mapDocument->getExtraEidValue($map_longitude_eid);
          $map_output =  executeQuery('addons.addon_insert_maplatlng.updateLatitude', $map_obj);           
          $map_output =  executeQuery('addons.addon_insert_maplatlng.updateLongitude', $map_obj);

          //mysqli DB
          $db_info = Context::getDBInfo();
          if($db_info->master_db["db_type"]=='mysqli'){
            $con = mysqli_connect($db_info->master_db["db_hostname"],$db_info->master_db["db_userid"],$db_info->master_db["db_password"],$db_info->master_db["db_database"]);

            $map_latitude = $mapDocument->getExtraEidValue($map_latitude_eid);
            $sql = "UPDATE ".$db_info->master_db["db_table_prefix"]."documents SET map_latitude='".$map_latitude."' where document_srl='".Context::get('document_srl')."'";
            mysqli_query($con, $sql);

            $map_longitude = $mapDocument->getExtraEidValue($map_longitude_eid);
            $sql = "UPDATE ".$db_info->master_db["db_table_prefix"]."documents SET map_longitude='".$map_longitude."' where document_srl='".Context::get('document_srl')."'";
            mysqli_query($con, $sql);
          }

        } else if($mapDocument->getExtraEidValue($map_address_eid)){
          if(Context::get('map_latitude') && Context::get('map_longitude')){
            $map_obj = '';
            $map_obj->document_srl = Context::get('document_srl');
            $map_obj->map_latitude = Context::get('map_latitude');
            $map_obj->map_longitude = Context::get('map_longitude');
            $map_output = executeQuery('addons.addon_insert_maplatlng.updateLatitude', $map_obj);
            $map_output = executeQuery('addons.addon_insert_maplatlng.updateLongitude', $map_obj);

            //mysqli DB
            $db_info = Context::getDBInfo();
            if($db_info->master_db["db_type"]=='mysqli'){
              $con = mysqli_connect($db_info->master_db["db_hostname"],$db_info->master_db["db_userid"],$db_info->master_db["db_password"],$db_info->master_db["db_database"]);

              $map_latitude = Context::get('map_latitude');
              $sql = "UPDATE ".$db_info->master_db["db_table_prefix"]."documents SET map_latitude='".$map_latitude."' where document_srl='".Context::get('document_srl')."'";
              mysqli_query($con, $sql);

              $map_longitude = Context::get('map_longitude');
              $sql = "UPDATE ".$db_info->master_db["db_table_prefix"]."documents SET map_longitude='".$map_longitude."' where document_srl='".Context::get('document_srl')."'";
              mysqli_query($con, $sql);
            }
            exit();
          }

 

 

<query id="updateLatitude" action="update">
    <tables>
        <table name="documents" />
    </tables>
    <columns>
        <column name="map_latitude" var="map_latitude" notnull="notnull" />
    </columns>
    <conditions>
        <condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
    </conditions>
</query>

 

         $map_obj->map_latitude = $mapDocument->getExtraEidValue($map_latitude_eid);
          $map_obj->map_longitude = $mapDocument->getExtraEidValue($map_longitude_eid);
          $map_output =  executeQuery('addons.addon_insert_maplatlng.updateLatitude', $map_obj);           

 

확장변수에서 위도 값을 가져와  executeQuery 로 db 에 위도 값이 제대로 들어가지가 않습니다. .....

 

위도경도.jpg

  • profile

    $map_obj 를 디버깅해서 앞서 만든 값들이 오브젝트를 재대로 생성햇는지 확인하고, 그게 아니라면 각각변수값에 왜 들어가지 않았는지 확인해보세요..

     

    안들어간대에는 executeQuery가 문제가 발생된게 아니라 오브젝트 변수를 잘 못만들어준 것이라 왜 그런지를 봐야합니다.

  • profile
    stdClass Object
    (
    [document_srl] => 135829
    [map_latitude] => 35.8587273
    [map_longitude] => 128.61181799999997
    )
    $map_obj 값은 들어가는데 xml로 값이 넘어 가지를 않네요 !!
  • profile
    https://xe1.xpressengine.com/qna/23207399