Skip to content

如果使用hasManyThrough的时候 附带where查询的情况  #2650

Open
@jie8699383

Description

@jie8699383

如果$foreignKey和$throughKey都是id的时候,会报错无法使用where查询,在src/model/relation/HasManyThrough.php下面增加代码判断
$throughKey = $this->throughKey;
if ($this->baseQuery) {
$throughKey = Str::snake(class_basename($this->model)) . "." . $this->throughKey;
}
可以解决问题
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions