You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
521 B
28 lines
521 B
<?php
|
|
|
|
namespace App\Entities\Pages;
|
|
|
|
use App\Entities\BaseRepository;
|
|
use App\Entities\Options\Option;
|
|
use App\Entities\Payments\Payment;
|
|
|
|
/**
|
|
* Pages Repository Class
|
|
*/
|
|
class PagesRepository extends BaseRepository
|
|
{
|
|
public function __construct(Option $model)
|
|
{
|
|
$this->model = $model;
|
|
}
|
|
|
|
public function getTotalIncome()
|
|
{
|
|
return Payment::whereType(1)->sum('amount');
|
|
}
|
|
|
|
public function getTotalExpenditure()
|
|
{
|
|
return Payment::whereType(0)->sum('amount');
|
|
}
|
|
}
|