Yii2 RestFull Api, Extrafields

I have this schema in my database.

time_sheet >== mission >== position >== order

One mission have many timesheets and one time sheet have just one mission.

One position have many missions and one mission have just one position.

One order have many positions and one position have just one order.

And in my class that extends from yii\rest\IndexAction I have this code (in the prepareDataProvider() method):

$query = $timeSheetModel->find()

->distinct()


->joinWith("mission")


->joinWith("mission.position")


->joinWith("mission.position.order")


->where("public.order.id = $id");

$results = new ActiveDataProvider([

'query' => $query,    

]);

return $results;

So how to personalise my extra fields to get a json with the following structure:

{

        "id": "3",


        "timeSheetField1": "1",


        "timeSheetField2": "1",


        "mission": {


            "id": "1",


            "mission field 1": 12,


          },


        "position": {


            "id": "1",


            "position field 1": 12,


          },


        "order": {


            "id": "1",


            "order field 1": 12,


          },


        "other calculable fields": {


            "id": "1",


            "other field 1": 12,


          }


    },