more modifications for moons
This commit is contained in:
@@ -45,15 +45,29 @@ class LoginController extends Controller
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout function
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function logout(Request $request) {
|
||||
Auth::logout();
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the provider's website
|
||||
*
|
||||
* @return Socialite
|
||||
*/
|
||||
public function redirectToProvider() {
|
||||
return Socialite::driver('eveonline')->setScopes(['publicData'])->redirect();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get token from callback
|
||||
* Redirect to the dashboard if logging in successfully.
|
||||
*/
|
||||
public function handleProviderCallback() {
|
||||
$ssoUser = Socialite::driver('eveonline')->user();
|
||||
|
||||
@@ -78,7 +92,7 @@ class LoginController extends Controller
|
||||
} else {
|
||||
//Get what type of account the user should have
|
||||
$accountType = $this->getAccountType($eve_user->refreshToken, $eve_user->getId());
|
||||
|
||||
//Create a user account
|
||||
return User::create([
|
||||
'name' => $eve_user->getName(),
|
||||
'email' => null,
|
||||
@@ -92,7 +106,15 @@ class LoginController extends Controller
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the appropriate account type the user should be assigned through ESI API
|
||||
*
|
||||
* @param refreshToken
|
||||
* @param charId
|
||||
*
|
||||
* @return text
|
||||
*/
|
||||
private function getAccountType($refreshToken, $charId) {
|
||||
//Set caching to null
|
||||
$configuration = Configuration::getInstance();
|
||||
@@ -117,7 +139,7 @@ class LoginController extends Controller
|
||||
$corp_info = $esi->invoke('get', '/corporations/{corporation_id}/', [
|
||||
'corporation_id' => $character_info->corporation_id,
|
||||
]);
|
||||
|
||||
//Send back the appropriate group
|
||||
if($corp_info->alliance_id == '99004116') {
|
||||
return 'W4RP';
|
||||
} else if(in_array($alliance_info->alliance_id, array(99006297, 498125261, 99003214, 99004136, 9900237, 99001657, 99006069, 99001099, 99003838))) {
|
||||
|
||||
@@ -4,8 +4,6 @@ namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Library;
|
||||
//use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
//use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -36,48 +34,7 @@ class DashboardController extends Controller
|
||||
}
|
||||
|
||||
public function profile() {
|
||||
/**
|
||||
* Check to see if the user has a valid esi token
|
||||
*/
|
||||
$user = Auth::user();
|
||||
//Try to find the user's ESI token.
|
||||
$token = DB::table('esitokens')->where('CharacterId', $user['character_id'])->first();
|
||||
if($token != null) {
|
||||
$html = '<h3>ESI Token Already Stored</h3>';
|
||||
} else {
|
||||
//Setup the display button if the user doesn't have an ESI registered
|
||||
$state = uniqid();
|
||||
session(['state' => $state]);
|
||||
$esiLogin = new \App\Library\EsiLogin();
|
||||
$html = $esiLogin->DisplayLoginButton($state);
|
||||
}
|
||||
|
||||
|
||||
return view('dashboard.profile')->with('html', $html);
|
||||
}
|
||||
|
||||
public function callback(Request $request) {
|
||||
$esiLogin = new \App\Library\EsiLogin();
|
||||
//Pull the old session state from the session, and delete the key
|
||||
$oldState = $request->session()->pull('state');
|
||||
//Check the state to make sure it matches
|
||||
if($oldState == $request->input('state')) {
|
||||
$esiLogin->RetrieveAccessToken();
|
||||
$esiLogin->RetrieveCharacterId();
|
||||
//Store the token in the database
|
||||
$token = new \App\EsiToken;
|
||||
$token->CharacterId = $esiLogin->GetCharacterId();
|
||||
$token->AccessToken = $esiLogin->GetAccessToken();
|
||||
$token->RefreshToken = $esiLogin->GetRefreshToken();
|
||||
$token->ExpiresIn = $esiLogin->GetRefreskTokenExpiry();
|
||||
$token->save();
|
||||
//Return view back to profile with success message
|
||||
return view('dashboard')->with('message', 'Success!');
|
||||
} else {
|
||||
//Return view with error message back to the dashboard
|
||||
return view('dashboard')->with('message', 'Error!');
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
public function displayMoons() {
|
||||
|
||||
@@ -1,306 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* W4RP Services
|
||||
* GNU Public License
|
||||
*/
|
||||
|
||||
namespace App\Library;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Session;
|
||||
|
||||
class EsiLogin {
|
||||
|
||||
private $characterId;
|
||||
private $characterName;
|
||||
private $tokenType;
|
||||
|
||||
private $corporationId;
|
||||
private $corporationName;
|
||||
|
||||
private $allianceId;
|
||||
private $allianceName;
|
||||
|
||||
private $logged;
|
||||
|
||||
private $refreshToken;
|
||||
private $refreshTokenExpiry;
|
||||
private $accessToken;
|
||||
|
||||
private $clientId;
|
||||
private $secretKey;
|
||||
private $useragent;
|
||||
private $scope;
|
||||
|
||||
public function __construct($client = null, $secret = null, $useragent = null) {
|
||||
if($client == null || $secret == null || $useragent == null) {
|
||||
//Parse the data for the ESI Configuration file
|
||||
$this->clientId = env('ESI_CLIENT_ID');
|
||||
$this->secretKey = env('ESI_SECRET_KEY');
|
||||
$this->useragent = env('ESI_USERAGENT');
|
||||
$this->scope = env('ESI_SCOPES');
|
||||
//$this->clientId = $fileEsi['client_id'];
|
||||
//$this->secretKey = $fileEsi['secret'];
|
||||
//$this->useragent = $fileEsi['useragent'];
|
||||
} else {
|
||||
$this->clientId = $client;
|
||||
$this->secretKey = $secret;
|
||||
$this->userAgent = $useragent;
|
||||
}
|
||||
}
|
||||
|
||||
public function GetCharacterId() {
|
||||
return $this->characterId;
|
||||
}
|
||||
|
||||
public function GetCharacterName() {
|
||||
return $this->characterName;
|
||||
}
|
||||
|
||||
public function GetCorporationId() {
|
||||
return $this->corporationId;
|
||||
}
|
||||
|
||||
public function GetCorporationName() {
|
||||
return $this->corporationName;
|
||||
}
|
||||
|
||||
public function GetAllianceId() {
|
||||
return $this->allianceId;
|
||||
}
|
||||
|
||||
public function GetAllianceName() {
|
||||
return $this->allianceName;
|
||||
}
|
||||
|
||||
public function GetAccessToken() {
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
public function GetRefreshToken() {
|
||||
return $this->refreshToken;
|
||||
}
|
||||
|
||||
public function GetRefreskTokenExpiry() {
|
||||
return $this->refreshTokenExpiry;
|
||||
}
|
||||
|
||||
public function SetAccessToken($access) {
|
||||
$this->accessToken = $access;
|
||||
}
|
||||
|
||||
public function SetRefreshtoken($refresh) {
|
||||
$this->refreshToken = $refresh;
|
||||
}
|
||||
|
||||
public function SetRefreshTokenExpiry($expire) {
|
||||
$this->refreshTokenExpiry = $expire;
|
||||
}
|
||||
|
||||
public function ESIStateMachine($state) {
|
||||
|
||||
switch($state) {
|
||||
case 'new':
|
||||
return $this->DisplayLoginButton();
|
||||
break;
|
||||
case 'eveonlinecallback':
|
||||
$this->VerifyCallback();
|
||||
if($this->logged == true) {
|
||||
return 'logged';
|
||||
} else {
|
||||
return 'notlogged';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->UnsetState();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function VerifyCallback() {
|
||||
if($this->CheckState() == 'okay') {
|
||||
$this->RetrieveAccessToken();
|
||||
$this->RetrieveCharacterId();
|
||||
|
||||
//Get all the information we might need, and store it
|
||||
$char = $this->GetESIInfo($this->characterId, 'Character', $this->useragent);
|
||||
$this->characterName = $char['name'];
|
||||
|
||||
$corp = $this->GetESIInfo($char['corporation_id'], 'Corporation', $this->useragent);
|
||||
$this->corporationId = $char['corporation_id'];
|
||||
$this->corporationName = $corp['name'];
|
||||
|
||||
if(isset($corp['alliance_id'])) {
|
||||
$ally = $this->GetESIInfo($corp['alliance_id'], 'Alliance', $this->useragent);
|
||||
$this->allianceId = $corp['alliance_id'];
|
||||
$this->allianceName = $ally['name'];
|
||||
}
|
||||
} else {
|
||||
$this->logged = false;
|
||||
}
|
||||
|
||||
if($this->characterId != null) {
|
||||
$this->logged = true;
|
||||
} else {
|
||||
$this->logged = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function DisplayLoginButton($state) {
|
||||
$html = "";
|
||||
$html .= "<div class=\"container\">";
|
||||
$html .= "<br><br><br>";
|
||||
$html .= "<div class=\"jumbotron\">";
|
||||
//$html .= "<h1><p align=\"center\">Warped Intentions Services Login</p></h1>";
|
||||
//$html .= "<br>";
|
||||
//$html .= "<p align=\"center\">One stop shop for the alliance services.</p>";
|
||||
//$html .= "<br>";
|
||||
$html .= "<p align=\"center\">";
|
||||
$html .= "<a href=\"https://login.eveonline.com/oauth/authorize/?response_type=code&redirect_uri=";
|
||||
$html .= env('ESI_CALLBACK_URI');
|
||||
$html .= "&client_id=" . $this->clientId;
|
||||
$html .= "&scope=" . urlencode($this->scope);
|
||||
$html .= "&state=";
|
||||
$html .= $state . "\">";
|
||||
$html .= "<img src=\"images/EVE_SSO_Login_Buttons_Large_Black.png\">";
|
||||
$html .= "</a>";
|
||||
$html .= "</p>";
|
||||
$html .= "</div>";
|
||||
$html .= "</div>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function CheckState($newState) {
|
||||
if($newState != session('state')) {
|
||||
$this->UnsetState();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function UnsetState() {
|
||||
Session::forget('state');
|
||||
}
|
||||
|
||||
public function RetrieveCharacterId() {
|
||||
$url = 'https://login.eveonline.com/oauth/verify';
|
||||
$header = 'Authorization: Bearer ' . $this->accessToken;
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $this->useragent);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array($header));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
$result = curl_exec($ch);
|
||||
$data = json_decode($result, true);
|
||||
|
||||
$this->characterId = $data['CharacterID'];
|
||||
$this->characterName = $data['CharacterName'];
|
||||
$this->tokenType = $data['TokenType'];
|
||||
}
|
||||
|
||||
public function RetrieveAccessToken() {
|
||||
Session::forget('key');
|
||||
$url = 'https://login.eveonline.com/oauth/token';
|
||||
$header = 'Authorization: Basic ' . base64_encode($this->clientId . ':' . $this->secretKey);
|
||||
$fields_string='';
|
||||
$fields = array(
|
||||
'grant_type' => 'authorization_code',
|
||||
'code' => $_GET['code']
|
||||
);
|
||||
foreach($fields as $key => $value) {
|
||||
$fields_string .= $key . '=' . $value . '&';
|
||||
}
|
||||
rtrim($fields_string . '&');
|
||||
//Initialize the curl channel
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $this->useragent);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array($header));
|
||||
curl_setopt($ch, CURLOPT_POST, count($fields));
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$data = json_decode($result, true);
|
||||
$this->accessToken = $data['access_token'];
|
||||
$this->refreshToken = $data['refresh_token'];
|
||||
$this->refreshTokenExpiry = time() + $data['expires_in'];
|
||||
}
|
||||
|
||||
public function RefreshAccess() {
|
||||
$url = 'https://login.eveonline.com/oauth/token';
|
||||
$header = 'Authorization: Basic ' . base64_encode($this->clientId . ':' . $this->secretKey);
|
||||
$fields_string = '';
|
||||
$fields = array(
|
||||
'grant_type' => 'refresh_token',
|
||||
'refresh_token' => $this->refreshToken
|
||||
);
|
||||
|
||||
foreach($fields as $key => $value) {
|
||||
$fields_string .= $key . '=' . $value . '&';
|
||||
}
|
||||
rtrim($fields_string, '&');
|
||||
//Initialize the cURL connection
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array($header));
|
||||
curl_setopt($ch, CURLOPT_POST, count($fields));
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
$result = curl_exec($ch);
|
||||
//Get the resultant data from the curl call in an array format
|
||||
$data = json_decode($result, true);
|
||||
//Modify the variables of the class
|
||||
$this->refreshToken = $data['refresh_token'];
|
||||
$this->refreshTokenExpiry = now() + $data['expires_in'];
|
||||
$this->accessToken = $data['access_token'];
|
||||
}
|
||||
|
||||
public function GetESIInfo($id, $type, $useragent = null) {
|
||||
if($useragent == null) {
|
||||
$useragent = $this->useragent;
|
||||
}
|
||||
$url = $this->BuildSingleUrl($type, $id);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
|
||||
curl_setopt($ch, CURLOPT_HTTPGET, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
$result = curl_exec($ch);
|
||||
//Check for a curl error
|
||||
if(curl_error($ch)) {
|
||||
return null;
|
||||
} else {
|
||||
curl_close($ch);
|
||||
$data = json_decode($result, true);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
private function BuildSingleUrl($type, $id) {
|
||||
$firstPart = 'https://esi.tech.ccp.is/latest/';
|
||||
$lastPart = '/?datasource=tranquility';
|
||||
|
||||
if($type == 'Character') {
|
||||
$url = $firstPart . 'characters/' . $id . $lastPart;
|
||||
} else if ($type == 'Corporation') {
|
||||
$url = $firstPart . 'corporations/' . $id . $lastPart;
|
||||
} else if ($type == 'Alliance') {
|
||||
$url = $firstPart . 'alliances/' . $id . $lastPart;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ namespace App\Library;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Session;
|
||||
use DB;
|
||||
|
||||
class MoonCalc {
|
||||
|
||||
@@ -21,7 +22,7 @@ class MoonCalc {
|
||||
//Total pull size is 14,385,600 m3
|
||||
$totalPull = 5.55 * (3600.00 * 24.00 * 30.00);
|
||||
//Get the configuration for pricing calculations
|
||||
$config = $db->fetchRow('SELECT * FROM Config');
|
||||
$config = DB::table('Config')->get();
|
||||
if($firstQuan >= 1.00) {
|
||||
$firstPerc = $firstQuan / 100.00;
|
||||
} else {
|
||||
@@ -43,52 +44,54 @@ class MoonCalc {
|
||||
$fourthPerc = $fourthQuan;
|
||||
}
|
||||
if($firstOre != "None") {
|
||||
$m3Size = $db->fetchColumn('SELECT m3Size FROM ItemComposition WHERE Name= :name', array('name' => $firstOre));
|
||||
$m3Size = DB::table('ItemComposition')->where('Name', $firstOre)->value('m3Size');
|
||||
//$m3Size = $db->fetchColumn('SELECT m3Size FROM ItemComposition WHERE Name= :name', array('name' => $firstOre));
|
||||
//Find the m3 value of the first ore
|
||||
$firstActualm3 = floor($firstPerc * $totalPull);
|
||||
//Calculate the units of the first ore
|
||||
$firstUnits = floor($firstActualm3 / $m3Size);
|
||||
//Get the unit price from the database
|
||||
$firstUnitPrice = $db->fetchColumn('SELECT UnitPrice FROM OrePrices WHERE Name= :name', array('name'=> $firstOre));
|
||||
$firstUnitPrice = DB::table('OrePrices')->where('UnitPrice', $firstOre)->value('UnitPrice');
|
||||
//$firstUnitPrice = $db->fetchColumn('SELECT UnitPrice FROM OrePrices WHERE Name= :name', array('name'=> $firstOre));
|
||||
//Calculate the total price for the first ore
|
||||
$firstTotal = $firstUnits * $firstUnitPrice;
|
||||
} else {
|
||||
$firstTotal = 0.00;
|
||||
}
|
||||
if($secondOre != "None") {
|
||||
$m3Size = $db->fetchColumn('SELECT m3Size FROM ItemComposition WHERE Name= :name', array('name' => $secondOre));
|
||||
$m3Size = DB::table('ItemComposition')->where('Name', $secondOre)->value('m3Size');
|
||||
//find the m3 value of the second ore
|
||||
$secondActualm3 = floor($secondPerc * $totalPull);
|
||||
//Calculate the units of the second ore
|
||||
$secondUnits = floor($secondActualm3 / $m3Size);
|
||||
//Get the unit price from the database
|
||||
$secondUnitPrice = $db->fetchColumn('SELECT UnitPrice FROM OrePrices WHERE Name= :name', array('name' => $secondOre));
|
||||
$secondUnitPrice = DB::table('OrePrices')->where('UnitPrice', $secondOre)->value('UnitPrice');
|
||||
//calculate the total price for the second ore
|
||||
$secondTotal = $secondUnits * $secondUnitPrice;
|
||||
} else {
|
||||
$secondTotal = 0.00;
|
||||
}
|
||||
if($thirdOre != "None") {
|
||||
$m3Size = $db->fetchColumn('SELECT m3Size FROM ItemComposition WHERE Name= :name', array('name' => $thirdOre));
|
||||
$m3Size = DB::table('ItemComposition')->where('Name', $thirdOre)->value('m3Size');
|
||||
//find the m3 value of the third ore
|
||||
$thirdActualm3 = floor($thirdPerc * $totalPull);
|
||||
//calculate the units of the third ore
|
||||
$thirdUnits = floor($thirdActualm3 / $m3Size);
|
||||
//Get the unit price from the database
|
||||
$thirdUnitPrice = $db->fetchColumn('SELECT UnitPrice FROM OrePrices WHERE Name= :name', array('name' => $thirdOre));
|
||||
$thirdUnitPrice = DB::table('OrePrices')->where('UnitPrice', $thirdOre)->value('UnitPrice');
|
||||
//calculate the total price for the third ore
|
||||
$thirdTotal = $thirdUnits * $thirdUnitPrice;
|
||||
} else {
|
||||
$thirdTotal = 0.00;
|
||||
}
|
||||
if($fourthOre != "None") {
|
||||
$m3Size = $db->fetchColumn('SELECT m3Size FROM ItemComposition WHERE Name= :name', array('name' => $fourthOre));
|
||||
$m3Size = DB::table('ItemComposition')->where('Name', $fourthOre)->value('m3Size');
|
||||
//Find the m3 value of the fourth ore
|
||||
$fourthActualm3 = floor($fourthPerc * $totalPull);
|
||||
//Calculate the units of the fourth ore
|
||||
$fourthUnits = floor($fourthActualm3 / $m3Size);
|
||||
//Get the unit price from the database
|
||||
$fourthUnitPrice = $db->fetchColumn('SELECT UnitPrice FROM OrePrices WHERE Name= :name', array('name' => $fourthOre));
|
||||
$fourthUnitPrice = DB::table('OrePrices')->where('UnitPrice', $fourthOre)->value('UnitPrice');
|
||||
//calculate the total price for the fourth ore
|
||||
$fourthTotal = $fourthUnits * $fourthUnitPrice;
|
||||
} else {
|
||||
@@ -97,7 +100,7 @@ class MoonCalc {
|
||||
//Calculate the total to price to be mined in one month
|
||||
$totalPriceMined = $firstTotal + $secondTotal + $thirdTotal + $fourthTotal;
|
||||
//Calculate the rental price. Refined rate is already included in the price from rental composition
|
||||
$rentalPrice = $totalPriceMined * ($config['RentalTax'] / 100.00);
|
||||
$rentalPrice = $totalPriceMined * ($config->RentalTax / 100.00);
|
||||
//Format the rental price to the appropriate number
|
||||
$rentalPrice = number_format($rentalPrice, "2", ".", ",");
|
||||
|
||||
@@ -114,15 +117,15 @@ class MoonCalc {
|
||||
$browser = false;
|
||||
printf("Running price update from command line.\n");
|
||||
}
|
||||
$db = DBOpen();
|
||||
|
||||
//Get the configuration from the config table
|
||||
$config = $db->fetchRow('SELECT * FROM Config');
|
||||
$config = DB::table('Config')->get();
|
||||
//Calculate refine rate
|
||||
$refineRate = $config['RefineRate'] / 100.00;
|
||||
$refineRate = $config->RefineRate / 100.00;
|
||||
//Calculate the current time
|
||||
$time = time();
|
||||
//Get the max time from the database
|
||||
$maxTime = $db->fetchColumn('SELECT MAX(Time) FROM Prices WHERE ItemId= :id', array('id' => 34));
|
||||
$maxTime = DB::select('SELECT MAX(Time) FROM Prices WHERE ItemId = ?', [34]);
|
||||
//Get the price of the basic minerals
|
||||
$tritaniumPrice = $db->fetchColumn('SELECT Price FROM Prices WHERE ItemId= :id AND Time= :time', array('id' => 34, 'time' => $maxTime));
|
||||
$pyeritePrice = $db->fetchColumn('SELECT Price FROM Prices WHERE ItemId= :id AND Time= :time', array('id' => 35, 'time' => $maxTime));
|
||||
|
||||
Reference in New Issue
Block a user