Exemplo n.º 1
0
 public function getDesigner()
 {
     try {
         $strCyid = isset($_GET['cyid']) ? $_GET['cyid'] : '';
         if (empty($strCyid)) {
             return get_rsp_result(false, 'cyid is empty');
         }
         $sql = Collect::getSelectDesignerSql($strCyid);
         global $g_arr_db_config;
         $dbConfig = $g_arr_db_config['designer'];
         $rows = $this->_getDb($dbConfig)->getRecords($sql);
         if ($rows === false) {
             Log::write('CollectTask::getDesigner():getRecords() failed, SQL:' . $sql, 'log');
             return get_rsp_result(false, 'get designer error');
         }
         $arrDesigner = array();
         foreach ($rows as $row) {
             $designer = new DesignerProtocol();
             $designer->setProtocol($row);
             $arrDesigner[] = $designer;
         }
         return json_encode(array('result' => true, 'designer' => $arrDesigner));
     } catch (Exception $e) {
         Log::write('CollectTask::getDesigner() excepton error:' . $e->getMessage(), 'log');
         $result = get_rsp_result(false, 'get designer exception');
         return $result;
     }
 }