* [refac] use dbh::$queries instead of dao::$querys.

This commit is contained in:
liugang
2025-05-26 17:33:42 +08:00
parent 9d07dce9c2
commit 4753fd38eb
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -3403,7 +3403,7 @@ class baseRouter
$fh = fopen($sqlLog, 'a');
fwrite($fh, date('Ymd H:i:s') . ": " . $this->getURI() . "\n");
foreach(dao::$querys as $query) fwrite($fh, " $query\n");
foreach(dbh::$queries as $query) fwrite($fh, " $query\n");
fwrite($fh, "\n");
fclose($fh);
}
+3 -3
View File
@@ -145,7 +145,7 @@ class dbh
try
{
if(class_exists('dao')) dao::$querys[] = "[$this->flag] " . dao::processKeywords($sql);
dbh::$queries[] = "[$this->flag] " . dao::processKeywords($sql);
return $this->pdo->exec($sql);
}
catch(PDOException $e)
@@ -167,7 +167,7 @@ class dbh
$sql = $this->formatSQL($sql);
try
{
if(class_exists('dao')) dao::$querys[] = "[$this->flag] " . dao::processKeywords($sql);
dbh::$queries[] = "[$this->flag] " . dao::processKeywords($sql);
return $this->pdo->query($sql);
}
catch(PDOException $e)
@@ -234,7 +234,7 @@ class dbh
{
try
{
if(class_exists('dao')) dao::$querys[] = "[$this->flag] " . dao::processKeywords($sql);
dbh::$queries[] = "[$this->flag] " . dao::processKeywords($sql);
return $this->pdo->query($sql);
}
catch(PDOException $e)
+2 -2
View File
@@ -43,7 +43,7 @@ class trace
'method' => $this->app->server->request_method,
'timeUsed' => round(getTime() - $this->app->startTime, 4) * 1000,
'memory' => round(memory_get_peak_usage() / 1024, 1),
'querys' => count(dao::$querys),
'querys' => count(dbh::$queries),
'caches' => 0,
'files' => count(get_included_files()),
'session' => session_id(),
@@ -70,7 +70,7 @@ class trace
*/
public function getRequestSqls()
{
$this->trace['sqlQuery'] = dao::$querys;
$this->trace['sqlQuery'] = dbh::$queries;
}
/**
+1 -1
View File
@@ -516,7 +516,7 @@ class commonModel extends model
{
$info['timeUsed'] = round(getTime() - $startTime, 4) * 1000;
$info['memory'] = round(memory_get_peak_usage() / 1024, 1);
$info['querys'] = count(dao::$querys);
$info['querys'] = count(dbh::$queries);
vprintf($this->lang->runInfo, $info);
return $info;
}