mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 08:02:48 +08:00
修正远程一对多
This commit is contained in:
@@ -130,10 +130,9 @@ class HasManyThrough extends Relation
|
|||||||
{
|
{
|
||||||
if (empty($this->baseQuery) && $this->parent->getData()) {
|
if (empty($this->baseQuery) && $this->parent->getData()) {
|
||||||
$through = $this->through;
|
$through = $this->through;
|
||||||
$model = $this->model;
|
$alias = Loader::parseName(basename(str_replace('\\', '/', $this->model)));
|
||||||
$alias = Loader::parseName(basename(str_replace('\\', '/', $model)));
|
|
||||||
$throughTable = $through::getTable();
|
$throughTable = $through::getTable();
|
||||||
$pk = (new $this->model)->getPk();
|
$pk = (new $through)->getPk();
|
||||||
$throughKey = $this->throughKey;
|
$throughKey = $this->throughKey;
|
||||||
$modelTable = $this->parent->getTable();
|
$modelTable = $this->parent->getTable();
|
||||||
$this->query->field($alias . '.*')->alias($alias)
|
$this->query->field($alias . '.*')->alias($alias)
|
||||||
|
|||||||
Reference in New Issue
Block a user