mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进Query类的getTableInfo方法
This commit is contained in:
@@ -48,7 +48,7 @@ class Query
|
|||||||
// 参数绑定
|
// 参数绑定
|
||||||
protected $bind = [];
|
protected $bind = [];
|
||||||
// 数据表信息
|
// 数据表信息
|
||||||
protected $info = [];
|
protected static $info = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 架构函数
|
* 架构函数
|
||||||
@@ -1356,7 +1356,7 @@ class Query
|
|||||||
}
|
}
|
||||||
|
|
||||||
$guid = $tableName;
|
$guid = $tableName;
|
||||||
if (!isset($this->info[$guid])) {
|
if (!isset(self::$info[$guid])) {
|
||||||
$info = $this->connection->getFields($tableName);
|
$info = $this->connection->getFields($tableName);
|
||||||
$fields = array_keys($info);
|
$fields = array_keys($info);
|
||||||
$bind = $type = [];
|
$bind = $type = [];
|
||||||
@@ -1374,9 +1374,9 @@ class Query
|
|||||||
} else {
|
} else {
|
||||||
$pk = null;
|
$pk = null;
|
||||||
}
|
}
|
||||||
$this->info[$guid] = ['fields' => $fields, 'type' => $type, 'bind' => $bind, 'pk' => $pk];
|
self::$info[$guid] = ['fields' => $fields, 'type' => $type, 'bind' => $bind, 'pk' => $pk];
|
||||||
}
|
}
|
||||||
return $fetch ? $this->info[$guid][$fetch] : $this->info[$guid];
|
return $fetch ? self::$info[$guid][$fetch] : self::$info[$guid];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user