0
我有以下关系:Laravel雄辩 - 方法来获得“孙子”,其中grandparent_id匹配
Tool:
-----
id
name
description
Competency:
-----------
id
name
description
tool_id
Indicator:
----------
id
name
description
competency_id
我想获得的所有直接落在指定工具下的指标(即孙子) 。关系是工具有很多能力,能力有很多指标。
我(伪)到目前为止的代码是:
hasManyThrough('Indicator', 'Competency', 'tool_id', 'competency_id')->where('tool_id', '=', 1)->get();
我想我要下去右线,但遇到麻烦的代码的权利。
我想你想告诉 “*工具有很多能力和竞争力有很多指标** **(而不是工具)*” 没有? – tomloprod
是的,我的错误。我会更新这个 – ugotchi