Skip to content

Instantly share code, notes, and snippets.

@YokiToki
Created October 5, 2017 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YokiToki/5011d03ef0c8530f0f2c7c154db0c67b to your computer and use it in GitHub Desktop.
Save YokiToki/5011d03ef0c8530f0f2c7c154db0c67b to your computer and use it in GitHub Desktop.
$customer = Customers::find()
->where(['Customer_id' => $customer_id])
->with('Orders')
->asArray()
->all();
[
{
"Customer_id": "3",
"Serial_number": "102",
"Name": "Johann Braun",
"Date_install": "2017-10-04 14:51:53",
"orders": [
{
"Order_id": "5",
"Customer_id": "3",
"Order": "228.551",
"Date": "2017-10-04 15:26:27"
},
{
"Order_id": "11",
"Customer_id": "3",
"Order": "120.452",
"Date": "2017-10-04 15:26:27"
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment