structure controller
This commit is contained in:
@@ -152,17 +152,17 @@ class StructureController extends Controller
|
|||||||
private function GetRevenue($corpId, $refType, $start, $end) {
|
private function GetRevenue($corpId, $refType, $start, $end) {
|
||||||
$revenue = 0.00;
|
$revenue = 0.00;
|
||||||
if($refType === 'Market') {
|
if($refType === 'Market') {
|
||||||
$revenue = CorpJournal::where(['ref_type' => 'brokers_fee', 'corporation_id' => $corpId])
|
$revenue = floatval(CorpJournal::where(['ref_type' => 'brokers_fee', 'corporation_id' => $corpId])
|
||||||
->whereBetween('date', [$start, $end])
|
->whereBetween('date', [$start, $end])
|
||||||
->sum('amount');
|
->sum('amount'));
|
||||||
} else if($refType === 'Refinery'){
|
} else if($refType === 'Refinery'){
|
||||||
$revenue = CorpJournal::where(['ref_type' => 'reprocessing_tax', 'corporation_id' => $corpId])
|
$revenue = floatval(CorpJournal::where(['ref_type' => 'reprocessing_tax', 'corporation_id' => $corpId])
|
||||||
->whereBetween('date', [$start, $end])
|
->whereBetween('date', [$start, $end])
|
||||||
->sum('amount');
|
->sum('amount'));
|
||||||
} else {
|
} else {
|
||||||
$revenue = 0.00;
|
$revenue = 0.00;
|
||||||
}
|
}
|
||||||
dd($revenue);
|
|
||||||
$revenue = number_format($revenue, 2, '.', ',');
|
$revenue = number_format($revenue, 2, '.', ',');
|
||||||
return $revenue;
|
return $revenue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user