标签:style mysq 数据 ble tps sql 查询 sel 表数据
关联时想对关联表数据筛选时:
MySQL查询:
SELECT * FROM A LEFT JOIN B ON A.B_id = B.id AND B.condition = $condition
ORM模型查询使用with():
Model::with([‘table_name‘ => function ($query) use ($condition) { $query->where( "condition", $condition) }])->get();)
轉載:https://laravel-china.org/articles/7171/laravel-learning-records-orm-with-usage-model-association
标签:style mysq 数据 ble tps sql 查询 sel 表数据
原文地址:https://www.cnblogs.com/clubs/p/9920820.html