Learning of thinkphp5 association model

When using the ORM of the ThinkPHP5 model, belongsTo and hasOne both represent a one-to-one relationship, but the two are not the same. When there is no foreign key associated with the two tables in the table, hasOne is used, and there are two tables associated in the table. Use belongsTo when the foreign key

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325078682&siteId=291194637