mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-02 21:41:36 +08:00
Model类属性tableName改为table Connection类getTableName 更改为 getTable
This commit is contained in:
@@ -135,7 +135,7 @@ abstract class Connection
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定当前数据表
|
||||
* 指定当前的数据表
|
||||
* @param string $table 数据表名称
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -146,11 +146,11 @@ abstract class Connection
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到完整的数据表名
|
||||
* 得到当前的数据表
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getTableName()
|
||||
public function getTable()
|
||||
{
|
||||
if (!$this->table) {
|
||||
$tableName = $this->config['prefix'];
|
||||
@@ -570,7 +570,7 @@ abstract class Connection
|
||||
{
|
||||
static $_info = [];
|
||||
if (!$tableName) {
|
||||
$tableName = $this->getTableName();
|
||||
$tableName = $this->getTable();
|
||||
}
|
||||
if (is_array($tableName)) {
|
||||
$tableName = key($tableName) ?: current($tableName);
|
||||
|
||||
@@ -850,11 +850,11 @@ class Query
|
||||
if (in_array($info['type'], [Relation::HAS_ONE, Relation::BELONGS_TO])) {
|
||||
if (0 == $i) {
|
||||
$joinName = Loader::parseName(basename(str_replace('\\', '/', $this->options['model'])));
|
||||
$joinTable = $this->connection->getTableName();
|
||||
$joinTable = $this->connection->getTable();
|
||||
$this->table($joinTable)->alias($joinName)->field(true, false, $joinTable, $joinName);
|
||||
}
|
||||
// 预载入封装
|
||||
$table = $info['model']::getTableName();
|
||||
$table = $info['model']::getTable();
|
||||
$name = Loader::parseName(basename(str_replace('\\', '/', $info['model'])));
|
||||
$this->via($name);
|
||||
$this->join($table . ' ' . $name, $joinName . '.' . $info['localKey'] . '=' . $name . '.' . $info['foreignKey'])->field(true, false, $table, $name, $name . '__');
|
||||
@@ -1269,7 +1269,7 @@ class Query
|
||||
|
||||
// 获取数据表
|
||||
if (empty($options['table'])) {
|
||||
$options['table'] = $this->connection->getTableName();
|
||||
$options['table'] = $this->connection->getTable();
|
||||
}
|
||||
|
||||
if (!isset($options['where'])) {
|
||||
|
||||
Reference in New Issue
Block a user