mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正HasManyThrough关联
This commit is contained in:
@@ -21,6 +21,8 @@ class HasManyThrough extends Relation
|
|||||||
{
|
{
|
||||||
// 中间关联表外键
|
// 中间关联表外键
|
||||||
protected $throughKey;
|
protected $throughKey;
|
||||||
|
// 中间表模型
|
||||||
|
protected $through;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 架构函数
|
* 架构函数
|
||||||
@@ -37,7 +39,7 @@ class HasManyThrough extends Relation
|
|||||||
{
|
{
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->middle = $through;
|
$this->through = $through;
|
||||||
$this->foreignKey = $foreignKey;
|
$this->foreignKey = $foreignKey;
|
||||||
$this->throughKey = $throughKey;
|
$this->throughKey = $throughKey;
|
||||||
$this->localKey = $localKey;
|
$this->localKey = $localKey;
|
||||||
@@ -90,7 +92,7 @@ class HasManyThrough extends Relation
|
|||||||
protected function baseQuery()
|
protected function baseQuery()
|
||||||
{
|
{
|
||||||
if (empty($this->baseQuery)) {
|
if (empty($this->baseQuery)) {
|
||||||
$through = $this->middle;
|
$through = $this->through;
|
||||||
$model = $this->model;
|
$model = $this->model;
|
||||||
$alias = Loader::parseName(basename(str_replace('\\', '/', $model)));
|
$alias = Loader::parseName(basename(str_replace('\\', '/', $model)));
|
||||||
$throughTable = $through::getTable();
|
$throughTable = $through::getTable();
|
||||||
|
|||||||
Reference in New Issue
Block a user