针对关联预载入的链式操作,我在这里还是采用一对多的关联模型。

    先来看数据库表:Users表、Profile表

    Users表
    image.png
    Profile表

    image.png
    Profile模型
    image.png

    Users模型
    image.png

    Users控制器
    image.png

    输出结果:
    image.png