where(['id' => $orderMainId]) ->with(['orders' => function($query) { return $query->with(['orderGoods']); }]) ->first()->toArray(); } }