📅  最后修改于: 2022-03-11 15:03:45.393000             🧑  作者: Mango
Product::where(['product_id'=>$id])->with('category')
->with('user')
->with('productbrand.brand') // product has onetomany relation 'productbrand'
//with table productbrand and productbrand has onetoone relation 'brand'
//with table brand
->first();