$wo = Warehouse_other_receive_detail::with('item_info.product_sub_group')
->where('item_info.product_sub_group->sub_group_id', 2)
->get();
如何在关系中选择条件后的特定列?
答案 0 :(得分:0)
您可以使用from pathlib import Path
Path('test/blah/foo/bar/').mkdir(parents=True, exist_ok=True)
with()
如果您只希望拥有$wo = Warehouse_other_receive_detail::with(['item_info.product_sub_group' => function($productSubGroup) {
$productSubGroup->where('sub_group_id', '=', 2);
}])
->get();
的{{1}}使用Warehouse_other_receive_detail
product_sub_group->sub_group_id = 2