$items = Model_Item::find($id, array('related' => array('images')));
$result = $items->to_array();
The output of $items is below ,I wonder how to get the image file_name ?
array(18) {
["id"]=>
string(2) "27"
["product_code"]=>
string(3) "666"
["item_color_id"]=>
string(1) "7"
["item_size_type_id"]=>
string(1) "1"
["classification_id"]=>
string(1) "1"
["name"]=>
string(5) "66666"
["display_name"]=>
string(8) "goods_18"
["usual_price"]=>
string(5) "88888"
["selling_price"]=>
string(3) "888"
["point_ratio"]=>
string(2) "88"
["description"]=>
string(3) "888"
["publish_start_datetime"]=>
string(19) "0000-00-00 00:00:00"
["publish_end_datetime"]=>
string(19) "0000-00-00 00:00:00"
["publish_flag"]=>
string(1) "8"
["created_at"]=>
string(19) "0000-00-00 00:00:00"
["updated_at"]=>
string(19) "0000-00-00 00:00:00"
["deleted_at"]=>
NULL
["images"]=>
array(1) {
[6]=>
array(6) {
["id"]=>
string(1) "6"
["file_name"]=>
string(36) "ea4c6011154b543e710b8809ed39b9db.jpg"
["content_type"]=>
string(10) "image/jpeg"
["created_at"]=>
string(19) "0000-00-00 00:00:00"
["updated_at"]=>
string(19) "0000-00-00 00:00:00"
["deleted_at"]=>
NULL
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!