我的代码:
public function users()
{
return $this->hasManyThrough(
'App\Models\User',
'App\Models\UserGroupDue',
'user_id',
'id',
'name',
'group_name'
);
}
我的用户表:
我的用户将到期表分组:
我的群组表:
答案 0 :(得分:0)
问题出在用户功能上
尝试
public function users()
{
return $this->hasManyThrough(
'App\Models\User',
'App\Models\UserGroupDue',
'user_id',
'group_name'
'id',
'name',
);
}