---------- 表 ----------
用户
- 用户身份
顾客
- 客户ID
- 用户身份
时间表
- schedule_id
- mail_id
- 客户ID
邮件
- mail_id
- 主题
- - - - - 楷模 - - - - -
schedules_model
public function customer()
{
return $this->belongsTo('App\Customer', 'customer_id');
}
public function mail()
{
return $this->belongsTo('App\Mail', 'mail_id');
}
public function user()
{
return $this->hasOneThrough(?);
}
--------- 控制器 ----------
$schedules = schedules_model->with('customer')->with('mail')->get();
请帮助我如何通过客户获取用户信息?非常感谢您的支持!