Add longitude and latitude to partner information in mobile API calls #231
This commit is contained in:
parent
f1f1d9253b
commit
7a8ff5bf42
1 changed files with 9 additions and 7 deletions
|
|
@ -2014,6 +2014,8 @@ class APIController extends Controller
|
||||||
'contact_nums' => $partner->getContactNumbers(),
|
'contact_nums' => $partner->getContactNumbers(),
|
||||||
'time_open' => $partner->getTimeOpen()->format("g:i A"),
|
'time_open' => $partner->getTimeOpen()->format("g:i A"),
|
||||||
'time_close' => $partner->getTimeClose()->format("g:i A"),
|
'time_close' => $partner->getTimeClose()->format("g:i A"),
|
||||||
|
'longitude' => $partner->getCoordinates()->getLongitude(),
|
||||||
|
'latitude' => $partner->getCoordinates()->getLatitude(),
|
||||||
'reviews' => $rev,
|
'reviews' => $rev,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -2051,10 +2053,10 @@ class APIController extends Controller
|
||||||
$result = $query->getResult();
|
$result = $query->getResult();
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
$partners = [];
|
||||||
foreach($result as $row)
|
foreach($result as $row)
|
||||||
{
|
{
|
||||||
$partner = [];
|
$partners[] = [
|
||||||
$partner[] = [
|
|
||||||
'id' => $row[0]->getID(),
|
'id' => $row[0]->getID(),
|
||||||
'name' => $row[0]->getName(),
|
'name' => $row[0]->getName(),
|
||||||
'branch' => $row[0]->getBranch(),
|
'branch' => $row[0]->getBranch(),
|
||||||
|
|
@ -2062,14 +2064,14 @@ class APIController extends Controller
|
||||||
'contact_nums' => $row[0]->getContactNumbers(),
|
'contact_nums' => $row[0]->getContactNumbers(),
|
||||||
'time_open' => $row[0]->getTimeOpen()->format("g:i A"),
|
'time_open' => $row[0]->getTimeOpen()->format("g:i A"),
|
||||||
'time_close' => $row[0]->getTimeClose()->format("g:i A"),
|
'time_close' => $row[0]->getTimeClose()->format("g:i A"),
|
||||||
];
|
'longitude' => $row[0]->getCoordinates()->getLongitude(),
|
||||||
|
'latitude' => $row[0]->getCoordinates()->getLatitude(),
|
||||||
$data[] = [
|
|
||||||
'partner' => $partner,
|
|
||||||
'db_distance' => $row['dist'],
|
'db_distance' => $row['dist'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['partners'] = $partners;
|
||||||
|
|
||||||
$res->setData($data);
|
$res->setData($data);
|
||||||
|
|
||||||
return $res->getReturnResponse();
|
return $res->getReturnResponse();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue