Clean up the GeoJSON generation code

This commit is contained in:
Nabeel Shahzad
2018-01-01 16:01:01 -06:00
parent d1c626afe8
commit 5cf0bbaa65
8 changed files with 233 additions and 160 deletions

View File

@@ -5,10 +5,6 @@ namespace App\Repositories;
use App\Models\Acars;
use App\Models\Pirep;
use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus;
use App\Repositories\Traits\CacheableRepository;
use Prettus\Repository\Contracts\CacheableInterface;
class AcarsRepository extends BaseRepository //implements CacheableInterface
{
@@ -19,9 +15,19 @@ class AcarsRepository extends BaseRepository //implements CacheableInterface
return Acars::class;
}
public function forPirep($pirep_id)
/**
* @param $pirep_id
* @param $type
* @return mixed
*/
public function forPirep($pirep_id, $type)
{
return $this->findWhere(['pirep_id' => $pirep_id]);
$where = [
'pirep_id' => $pirep_id,
'type' => $type,
];
return $this->orderBy('created_at', 'asc')->findWhere($where);
}
/**