mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
修正关联查询的软删除数据问题
This commit is contained in:
@@ -57,7 +57,7 @@ abstract class Connection
|
||||
// 监听回调
|
||||
protected static $event = [];
|
||||
// 查询对象
|
||||
protected $query = [];
|
||||
protected $query;
|
||||
// 使用Builder类
|
||||
protected $builder;
|
||||
// 数据库连接参数配置
|
||||
@@ -136,20 +136,33 @@ abstract class Connection
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定当前使用的查询对象
|
||||
* @access public
|
||||
* @param Query $query 查询对象
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuery($query)
|
||||
{
|
||||
$this->query = $query;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建指定模型的查询对象
|
||||
* @access public
|
||||
* @param string $model 模型类名称
|
||||
* @param string $queryClass 查询对象类名
|
||||
* @return Query
|
||||
*/
|
||||
public function getQuery($model = 'db', $queryClass = '')
|
||||
public function getQuery()
|
||||
{
|
||||
if (!isset($this->query[$model])) {
|
||||
$class = $queryClass ?: $this->config['query'];
|
||||
$this->query[$model] = new $class($this, 'db' == $model ? '' : $model);
|
||||
if (!isset($this->query)) {
|
||||
$class = $this->config['query'];
|
||||
|
||||
$this->query = new $class($this);
|
||||
}
|
||||
return $this->query[$model];
|
||||
|
||||
return $this->query;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user