a-omsk / veglaravel

Alpha version of server application, based on Laravel 5.0 PHP framework
GNU General Public License v3.0
2 stars 0 forks source link

API must return locations with unique coords as an array #5

Closed a-omsk closed 8 years ago

a-omsk commented 8 years ago

Locations with same coordinates (i.e located in one marker) should be returned as an array within object. If a location has unique coords, api must return a one-item-array;

for example:

[{
        "id": 1,
        "coordinates": "54.9769240537932, 73.39931488037111",
        "name": "testetst",
        "type": "restaurant",
        "specification": "vegetarian"
    }, {
        "id": 2,
        "coordinates": "54.9769240537932, 73.39931488037111",
        "name": "Another test place",
        "type": "eatery",
        "specification": "vegetarian"
    }
]
[{
    "id": 1,
    "coordinates": "54.9769240537932, 73.39931488037111",
    "locations": [{
        "location_id": 1,
        "name": "testetst",
        "type": "restaurant",
        "specification": "vegetarian"
    }, {
        "location_id": 2,
        "name": "Another test place",
        "type": "eatery",
        "specification": "vegetarian"
    }]
}]
a-omsk commented 8 years ago

Temporary solution was implemented, but we need high-performance sql solution for this issue, i think

RussianBruteForce commented 8 years ago

Use dev branch instead of master! I'll try to look and do some on that way tomorrow.

a-omsk commented 8 years ago

done