我有两个包含以下字段的表
adviser_group
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INT(10) UNSIGNED NOT NULL,
`organization_id` INT(10) UNSIGNED NOT NULL,
organizations
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_unicode_ci',
`status` TINYINT(4) NOT NULL DEFAULT '0',
adviser_group有1行, 组织有很多行
使用laravel uloquent我试试这个,
$organization = OrganizationAdviserGroup::with('organization')
->where('user_id', '=', Auth::user()->id)
->get();
但我得到的是organization = null
我做错了吗?