示例#1
0
 /**
  *
  * Enter description here ...
  * @param string $id 语言id
  * @param int  $flag 标志(1:返回数组,0:返回语言)
  */
 public function get_language($id, $flag = 0)
 {
     if (is_array($id)) {
         $sql = "SELECT * FROM language_error WHERE phrase_id IN (#phrase_id#)";
         $data = $this->get_list($sql, 'phrase_id', $id);
         if ($flag == 0) {
             $data = Com_Array::arr2_to_arr1($data, 'phrase_id,phrase_value');
         }
         return $data;
     } else {
         $cacheKey = $this->get_cache_key(array('phrase_id' => $id));
         $sql = "SELECT * FROM language_error WHERE phrase_id = '{$id}'";
         $item = $this->select_one($sql, $cacheKey);
         if ($flag == 0) {
             $item = $item['phrase_value'];
         }
         return $item;
     }
 }