API
- 启动API
vendor/bin/init-proxy.sh && php bin/hyperf.php start
- 生成model:
php bin/hyperf.php gen:model product_category
-管理模型 一对多
/**
* 关联楼宇推荐书关联表
* 远程一对一
*/
public function buildingPanos()
{
return $this->hasManyThrough(
'App\Building', // 远程表
'App\ModelList\BuildingPano', // 中间表
'pano_id', // 中间表对主表的关联字段
'id', // 远程表对中间表的关联字段
'pano_config_id', // 主表对中间表的关联字段
'building_id' // 中间表对远程表的关联字段
);
}