diff --git a/src/Http/DataTables/Tools/MoonsDataTable.php b/src/Http/DataTables/Tools/MoonsDataTable.php index ee2585448..5a69260c1 100644 --- a/src/Http/DataTables/Tools/MoonsDataTable.php +++ b/src/Http/DataTables/Tools/MoonsDataTable.php @@ -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]); } /** diff --git a/src/resources/views/tools/moons/modals/components/content.blade.php b/src/resources/views/tools/moons/modals/components/content.blade.php index a66e638ff..1b57cb096 100644 --- a/src/resources/views/tools/moons/modals/components/content.blade.php +++ b/src/resources/views/tools/moons/modals/components/content.blade.php @@ -58,7 +58,7 @@