testing moon worth job
This commit is contained in:
@@ -5,17 +5,13 @@ namespace App\Console\Commands\Data;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Log;
|
use Log;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
//Models
|
use Illuminate\Support\Str;
|
||||||
use App\Models\ScheduledTask\ScheduleJob;
|
use App\Library\Helpers\LookupHelper;
|
||||||
use App\Jobs\Commands\Eve\SendEveMail;
|
|
||||||
|
|
||||||
//Library
|
|
||||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
|
||||||
use App\Library\Esi\Esi;
|
use App\Library\Esi\Esi;
|
||||||
use Seat\Eseye\Cache\NullCache;
|
use App\Library\Moons\MoonCalc;
|
||||||
use Seat\Eseye\Configuration;
|
use App\Models\MoonRental\AllianceMoon;
|
||||||
use App\Library\Helpers\FinanceHelper;
|
use App\Models\MoonRental\AllianceMoonOre;
|
||||||
|
|
||||||
class Test extends Command
|
class Test extends Command
|
||||||
{
|
{
|
||||||
@@ -50,39 +46,24 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$esiHelper = new Esi;
|
//Declare variables
|
||||||
$config = config('esi');
|
$lookup = new LookupHelper;
|
||||||
|
$mHelper = new MoonCalc;
|
||||||
|
$months = 3;
|
||||||
|
$rentalTax = 0.25;
|
||||||
|
$worth1;
|
||||||
|
$worth2;
|
||||||
|
|
||||||
$refreshToken = $esiHelper->GetRefreshToken($config['primary']);
|
$moons = AllianceMoon::all();
|
||||||
$esi = $esiHelper->SetupEsiAuthentication($refreshToken);
|
|
||||||
|
|
||||||
$recipient = $config['primary'];
|
foreach($moons as $moon) {
|
||||||
$recipientType = 'character';
|
//Declare the arrays needed
|
||||||
$subject = "Just A Test for Eseye";
|
$ores = array();
|
||||||
$sender = $config['primary'];
|
|
||||||
$body = "F0KlvSA9vrXWYK0IuMhSAbfaOAMmQO5U2CD69Dn0JOk26B8HnSPPkhSG3JzlawHjbBd16HAIbaawbv9304EaoTRctpu5cnZo0GoHINi3R7pNGi0IZTWKG4EArwWbSujwX9KPvMqGNbcSorrIEslw6neXWW1kcDN0GMcvV6SeoM23cSkK33cAbR4DTeqUXZ9ULuFy31UPXfEcaNzKREbqKPlgChYcGdCyHG1J25qrEmPlOTPI1NQQkh71HvHJTVA7bmTgLEJMdFYHbc3ZzGOB9RFLfhdkGEGl2f3OQNyDAJIKW2mNQVlRVGc3Emvm42czpsH8ojn3BX5nuEFxNfjgue8hhdBIZSKm232U2l0xsPGZOzHvQdYs8bLw7ZQX1drV9qOPnbhgzbFLxEvQoGDquhKAdlo7bhkgoCn5IiY3BbQ5qnKVodymb58gj9Pd67GxjJ8K0854c91KkrJNEOCyiVcqKYqNDtKkB7hgjBLZUKRtWUkOf9j1qIRARoGzTGdqK20yvfaVIWetVqjw5UvzQC2pynHkvIw2X3aD49ghY7UOzXUceKJ8taF4ZaMvW34r5OvyTrjVo4PKV9TylIODmzg1U0s4joxz58f1A6BNp2fCs1YzNOObuMaxGjek47jv2gDgyhQnmi5uaREcGn5AAwgMUc55GPY2jevRTHo9scMqm5amaJUBQ3TgXvFSfS33LxD8xJjdKw7KB06stDQzdjyVb52mAdm5WchOOpGy3EXntBSzsfUHc4XEqql7lKTPLgBzeYxt9EagGP96Li4dABg2MaLuU4i1CWdV49ZdPwOt1OjwNU4QtfR02C6Vw7raCFl3mqWBgLke9O5dC8Lh3ojg7FBATstSuur2n41Rn4YwzGaiWJ3qKwTsJGL3k8PaHEsvwvq56w4Qjt8CqJsmAV1nsfKMFZaVlcbK3PFN5oHaDbQwDh4IVdwA8UPPnrn2wSuugi8QlVyUA8z9iVYMW8OdzHFn98zl7a2Bua5M";
|
|
||||||
|
|
||||||
SendEveMail::dispatch($body, $recipient, $recipientType, $subject, $sender);
|
$ores = AllianceMoonOre::where([
|
||||||
|
'moon_id' => $moon->moon_id,
|
||||||
|
])->get(['ore_id', 'quantity'])->toArray();
|
||||||
|
|
||||||
/*
|
|
||||||
try {
|
|
||||||
$response = $esi->setBody([
|
|
||||||
'approved_cost' => 100,
|
|
||||||
'body' => "Welcome to this test message.<br>" . $body,
|
|
||||||
'recipients' => [[
|
|
||||||
'recipient_id' => $config['primary'],
|
|
||||||
'recipient_type' => 'character',
|
|
||||||
]],
|
|
||||||
'subject' => 'Just a Test',
|
|
||||||
])->invoke('post', '/characters/{character_id}/mail/', [
|
|
||||||
'character_id' => $config['primary'],
|
|
||||||
]);
|
|
||||||
} catch(RequestFailedException $e) {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var_dump($response);
|
|
||||||
dd($response->getErrorCode());
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,31 +36,6 @@ class TestController extends Controller
|
|||||||
return view('test.char.display')->with('char', $char);
|
return view('test.char.display')->with('char', $char);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TestAllianceMoonWorth() {
|
|
||||||
//Declare variables
|
|
||||||
$lookup = new LookupHelper;
|
|
||||||
$mHelper = new MoonCalc;
|
|
||||||
$months = 3;
|
|
||||||
$rentalTax = 0.25;
|
|
||||||
$worth1;
|
|
||||||
$worth2;
|
|
||||||
|
|
||||||
$moons = AllianceMoon::all();
|
|
||||||
|
|
||||||
foreach($moons as $moon) {
|
|
||||||
//Declare the arrays needed
|
|
||||||
$ores = array();
|
|
||||||
|
|
||||||
$ores = AllianceMoonOre::where([
|
|
||||||
'moon_id' => $moon->moon_id,
|
|
||||||
])->get(['ore_id', 'quantity'])->toArray();
|
|
||||||
|
|
||||||
return view('test.moonworth.moon')->with('ores', $ores);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function DebugMiningTaxesInvoices() {
|
public function DebugMiningTaxesInvoices() {
|
||||||
$lookup = new LookupHelper;
|
$lookup = new LookupHelper;
|
||||||
$ledgers = new Collection;
|
$ledgers = new Collection;
|
||||||
|
|||||||
@@ -150,7 +150,6 @@ Route::group(['middleware' => ['auth']], function(){
|
|||||||
Route::get('/test/char/display', 'Test\TestController@displayCharTest');
|
Route::get('/test/char/display', 'Test\TestController@displayCharTest');
|
||||||
Route::get('/test/miningtax/invoice', 'Test\TestController@DebugMiningTaxesInvoices');
|
Route::get('/test/miningtax/invoice', 'Test\TestController@DebugMiningTaxesInvoices');
|
||||||
Route::get('/test/miningtax/observers', 'Test\TestController@DebugMiningObservers');
|
Route::get('/test/miningtax/observers', 'Test\TestController@DebugMiningObservers');
|
||||||
Route::get('/test/moon/worth', 'Test\TestController@TestAllianceMoonWorth');
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user