if (1/*Для отключения*/ and ( ((strlen($query) == 193) and (substr($query,0,132) == "SELECT accounts.*,accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c WHERE accounts.id = '")) or ((strlen($query) == 205) and (substr($query,0,167) == "SELECT opportunities.*,opportunities_cstm.* FROM opportunities LEFT JOIN opportunities_cstm ON opportunities.id = opportunities_cstm.id_c WHERE opportunities.id = '")) )) { //[НАЧАЛО]Новый алгоритм исключающий для некоторых запросов повторное обращение к базе данных //echo "$query\n"; $sqlMD5 = md5($query); if (isset($GLOBALS["sugTestCa"]["sugAccCstmCache$sqlMD5"]) and is_array($GLOBALS["sugTestCa"]["sugAccCstmCache$sqlMD5"])) { $row = $GLOBALS["sugTestCa"]["sugAccCstmCache$sqlMD5"]; // echo "$query\n"; //var_dump(count($GLOBALS["sugTestCa"]));//SELECT accounts.*,accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c WHERE accounts.id = 'f62c03b3-1a8c-8517-40b4-5f0c138b23cd' AND accounts.deleted=0 //[КОНЕЦ]Новый алгоритм исключающий для некоторых запросов повторное обращение к базе данных } else { $result = $this->db->limitQuery($query,0,1,true, "Retrieving record by id $this->table_name:$id found "); if(empty($result)) {return null;} $row = $this->db->fetchByAssoc($result, -1, $encode);$GLOBALS["sugTestCa"]["sugAccCstmCache$sqlMD5"] = $row; } } else { //[НАЧАЛО]Старый алгоритм $result = $this->db->limitQuery($query,0,1,true, "Retrieving record by id $this->table_name:$id found "); if(empty($result)) { return null; } $row = $this->db->fetchByAssoc($result, -1, $encode); //[КОНЕЦ]Старый алгоритм }