public function user()
    {
        return $this->belongsTo('User', 'user_id', '', 'left')->setEagerlyType(0);
    }

 方法中用 with('user')  查询时直接调用user.userinfo来展示输出

相关文章: