ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
``` tp5一对一关联 ``` ``` **public function** Member() { **return** $this\->hasOne(**'Member'**,**'member\_id'**, **'****order\_mid****'**); } 关联表**Member** 关联表里字段**member\_id** 主表的外键字段**order\_mid** ~~~ OModel::where($where)->with('Member')->order($order)->paginate($page); ~~~ **SQLSTATE\[42S22\]: Column not found: 1054 Unknown column 'Orders.member\_id' in 'on clause'** # SQLSTATE\[42S22\]: Column not found: 1054 Unknown column 'Orders.member\_info\_mid' in 'on clause' ```