Add container size id and name to battery information. #537
This commit is contained in:
parent
870ed4b730
commit
4556c391e3
1 changed files with 10 additions and 0 deletions
|
|
@ -33,10 +33,20 @@ class BatteryController extends APIController
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($batteries as $batt)
|
foreach ($batteries as $batt)
|
||||||
{
|
{
|
||||||
|
$csize_id = '';
|
||||||
|
$csize_name = '';
|
||||||
|
if ($batt->getContainerSize() != null)
|
||||||
|
{
|
||||||
|
$csize_id = $batt->getContainerSize()->getID();
|
||||||
|
$csize_name = $batt->getContainerSize()->getName();
|
||||||
|
}
|
||||||
|
|
||||||
$result[] = [
|
$result[] = [
|
||||||
'id' => $batt->getID(),
|
'id' => $batt->getID(),
|
||||||
'size' => $batt->getSize()->getID(),
|
'size' => $batt->getSize()->getID(),
|
||||||
'brand' => $batt->getBrand()->getID(),
|
'brand' => $batt->getBrand()->getID(),
|
||||||
|
'container_size_id' => $csize_id,
|
||||||
|
'container_size_name' => $csize_name,
|
||||||
'date_update' => $batt->getDateUpdate()->format('YmdHis'),
|
'date_update' => $batt->getDateUpdate()->format('YmdHis'),
|
||||||
'flag_new' => $batt->isNew(),
|
'flag_new' => $batt->isNew(),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue