tp5 关联预载入 model中的方法

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

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

╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯
原文地址:https://www.cnblogs.com/zhangcheng001/p/12772680.html