Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Http/DataTables/Tools/MoonsDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public function query()
'moon.solar_system.sovereignty.alliance', 'moon.solar_system.sovereignty.corporation', 'content')
->select()
//this is not an SQL injection since $mining_volume is a constant int on a class
->selectRaw('(SELECT SUM(rate * ? * ?/invTypes.volume*market_prices.adjusted_price) FROM universe_moon_contents JOIN invTypes ON invTypes.typeID=universe_moon_contents.type_id JOIN market_prices ON market_prices.type_id=universe_moon_contents.type_id WHERE moon_id=universe_moon_reports.moon_id) as raw_value', [$mining_volume, $hours_per_month])
->selectRaw('(select SUM((select SUM(invTypeMaterials.quantity*market_prices.adjusted_price) from invTypeMaterials join market_prices on market_prices.type_id=invTypeMaterials.materialTypeID where invTypeMaterials.typeID=universe_moon_contents.type_id) * universe_moon_contents.rate * ? * ? / invTypes.volume * ? / 100) from universe_moon_contents join invTypes on invTypes.typeID=universe_moon_contents.type_id where universe_moon_contents.moon_id=universe_moon_reports.moon_id) as refined_value', [$mining_volume, $hours_per_month, $reprocessing_yield]);
->selectRaw('(SELECT SUM(rate * ? * ?/invTypes.volume*market_prices.sell_price) FROM universe_moon_contents JOIN invTypes ON invTypes.typeID=universe_moon_contents.type_id JOIN market_prices ON market_prices.type_id=universe_moon_contents.type_id WHERE moon_id=universe_moon_reports.moon_id) as raw_value', [$mining_volume, $hours_per_month])
->selectRaw('(select SUM((select SUM(invTypeMaterials.quantity*market_prices.sell_price) from invTypeMaterials join market_prices on market_prices.type_id=invTypeMaterials.materialTypeID where invTypeMaterials.typeID=universe_moon_contents.type_id) * universe_moon_contents.rate * ? * ? / invTypes.volume * ? / 100) from universe_moon_contents join invTypes on invTypes.typeID=universe_moon_contents.type_id where universe_moon_contents.moon_id=universe_moon_reports.moon_id) as refined_value', [$mining_volume, $hours_per_month, $reprocessing_yield]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<td>{{ number_format($type->pivot->rate * 100, 2) }} %</td>
<td>{{ number_format($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720, 2) }} m3</td>
<td>{{ number_format(($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720) / $type->volume) }}</td>
<td>{{ number_format((($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720) / $type->volume) * $type->price->adjusted_price, 2) }}</td>
<td>{{ number_format((($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720) / $type->volume) * $type->price->sell_price, 2) }}</td>
</tr>
@endforeach
<tfoot>
Expand Down Expand Up @@ -99,7 +99,7 @@
</td>
<td>{{ number_format($material->sum('pivot.quantity') * $material->first()->volume, 2) }} m3</td>
<td>{{ number_format($material->sum('pivot.quantity')) }}</td>
<td>{{ number_format($material->sum('pivot.quantity') * $material->first()->price->adjusted_price) }}</td>
<td>{{ number_format($material->sum('pivot.quantity') * $material->first()->price->sell_price) }}</td>
</tr>
@endforeach
<tfoot>
Expand Down