framework icon indicating copy to clipboard operation
framework copied to clipboard

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

Open jie8699383 opened this issue 3 years ago • 0 comments

如果$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

jie8699383 avatar Jan 19 '22 08:01 jie8699383