Make sure we're getting only active expenses

This commit is contained in:
Nabeel Shahzad 2020-09-12 15:17:10 -04:00
parent ac7a5a65e5
commit 2dd3dd5814

View File

@ -8,9 +8,6 @@ use Illuminate\Support\Collection;
use Prettus\Repository\Contracts\CacheableInterface; use Prettus\Repository\Contracts\CacheableInterface;
use Prettus\Repository\Traits\CacheableRepository; use Prettus\Repository\Traits\CacheableRepository;
/**
* Class ExpenseRepository
*/
class ExpenseRepository extends Repository implements CacheableInterface class ExpenseRepository extends Repository implements CacheableInterface
{ {
use CacheableRepository; use CacheableRepository;
@ -35,6 +32,7 @@ class ExpenseRepository extends Repository implements CacheableInterface
{ {
$where = [ $where = [
'type' => $type, 'type' => $type,
'active' => true,
['airline_id', '=', null], ['airline_id', '=', null],
]; ];
@ -59,6 +57,7 @@ class ExpenseRepository extends Repository implements CacheableInterface
if ($airline_id) { if ($airline_id) {
$where = [ $where = [
'type' => $type, 'type' => $type,
'active' => true,
'airline_id' => $airline_id, 'airline_id' => $airline_id,
]; ];