[01-Oct-2020 13:07:57 Europe/Moscow] PHP Notice: Undefined index: lang in /home/public_html/api/Languages.php on line 67
[01-Oct-2020 13:07:57 Europe/Moscow] PHP Warning: Creating default object from empty value in /home/public_html/api/Languages.php on line 82
Ругается на строчку
67
$lang = $params['lang'] ? $params['lang'] : $this->lang_id();
82
$result->join = $lang_join;
public function get_query($params = array())
{
$lang = $params['lang'] ? $params['lang'] : $this->lang_id();
$object = $params['object'];
if(!empty($params['px'])) $px = $params['px'];
else $px = $object[0];
$this->db->query("SHOW TABLES LIKE '%__languages%'");
$exist = $this->db->result();
if(!isset($lang) && $this->settings->lang_default)$lang = $this->settings->lang_default;
if(isset($lang) && $exist && !empty($this->languages)){$f = 'l'; $lang_join = 'LEFT JOIN __lang_'.$this->tables[$object].' l ON l.'.$object.'_id='.$px.'.id AND l.lang_id = '.(int)$lang;}
else{$f = $px; $lang_join = '';}
$lang_col = $f.'.'.implode(', '.$f.'.',$this->get_fields($this->tables[$object]));
$result->join = $lang_join;
$result->fields = $lang_col;
return $result;
}