We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://segmentfault.com/q/1010000014056473/a-1020000014069076 补充点,模型关系底层的sql语句是单独去查的,比如$order->user->user_name,会执行两条sql,一条查order数据,一条根据order数据返回的user_id去查user表数据。意味着如果分库了只需在模型里加个对应的connection指定下即可,而用join形式就比较麻烦,需要改对应的join代码, 而且也不支持跨库join,用关系的话可以跨库获取数据。
$order->user->user_name
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://segmentfault.com/q/1010000014056473/a-1020000014069076
补充点,模型关系底层的sql语句是单独去查的,比如
$order->user->user_name
,会执行两条sql,一条查order数据,一条根据order数据返回的user_id去查user表数据。意味着如果分库了只需在模型里加个对应的connection指定下即可,而用join形式就比较麻烦,需要改对应的join代码, 而且也不支持跨库join,用关系的话可以跨库获取数据。The text was updated successfully, but these errors were encountered: