mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Connection类model方法更改为getQuery
This commit is contained in:
@@ -178,7 +178,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$connection = [];
|
||||
}
|
||||
// 设置当前模型 确保查询返回模型对象
|
||||
$query = Db::connect($connection)->model($model, $this->query);
|
||||
$query = Db::connect($connection)->getQuery($model, $this->query);
|
||||
|
||||
// 设置当前数据表和模型名
|
||||
if (!empty($this->table)) {
|
||||
|
||||
@@ -137,7 +137,7 @@ abstract class Connection
|
||||
* @param string $queryClass 查询对象类名
|
||||
* @return Query
|
||||
*/
|
||||
public function model($model = 'db', $queryClass = '')
|
||||
public function getQuery($model = 'db', $queryClass = '')
|
||||
{
|
||||
if (!isset($this->query[$model])) {
|
||||
$class = $queryClass ?: $this->config['query'];
|
||||
@@ -155,7 +155,7 @@ abstract class Connection
|
||||
*/
|
||||
public function __call($method, $args)
|
||||
{
|
||||
return call_user_func_array([$this->model(), $method], $args);
|
||||
return call_user_func_array([$this->getQuery(), $method], $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user