改进Query类

This commit is contained in:
thinkphp
2016-05-18 10:20:34 +08:00
parent c0048e80ea
commit 198ea76923
2 changed files with 15 additions and 3 deletions

View File

@@ -786,14 +786,26 @@ class Query
}
/**
* 指定数据表
* 指定默认数据表
* @access public
* @param string $table 表名
* @return $this
*/
public function setTable($table)
{
$this->table = $table;
return $this;
}
/**
* 指定当前操作的数据表
* @access public
* @param string $table 表名
* @return $this
*/
public function table($table)
{
$this->table = $table;
$this->options['table'] = $table;
return $this;
}