update to time / date for rental end column

This commit is contained in:
2019-02-13 05:40:01 -06:00
parent c46c05e440
commit 8491799895
6 changed files with 78 additions and 131 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class moonmailer extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:name';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
}
}

View File

@@ -1,98 +0,0 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Carbon\Carbon;
use App\Jobs\SendEveMail;
use Commands\Library\CommandHelper;
use App\Library\Esi\Esi;
use App\Library\Esi\Mail;
use App\Library\Clones\CloneSaver;
use App\Models\Character\CharacterClone;
use App\Models\Mail\EveMail;
use App\Models\Esi\EsiScope;
use App\Models\Esi\EsiToken;
class RunCloneSaver extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:clonesaver';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Performs the functionality for clone saver';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Create the command helper container
$task = new CommandHelper('CloneSaver');
//Add the entry into the jobs table saying the job is starting
$task->SetStartStatus();
//Mark the job as finished
$task->SetStopStatus();
}
private function CheckEsiScope() {
//Check the esi scope.
//If the esi scopes are not present then send a mail
$mail = new EveMail;
$mail->sender = 93738489;
$mail->subject = 'Incorrect ESI Scope(s)';
$mail->body = "You don't have the correct ESI Scope(s) registered.<br>" .
"Please register the following scopes:<br>" .
$scopes .
"Sincerely,<br>" .
"Amund Risalo";
$mail->recipient = (int)$charId;
$mail->recipient_type = 'character';
$mail->save();
SendEveMail::dispatch($mail);
}
private function CloneSaverMail() {
//Setup time frame job has been sent so we don't send too many mails
//Store a new eve mail model for the job to dispatch
$mail = new EveMail;
$mail->sender = $self;
$mail->subject = 'Clone Saver Alert';
$mail->body = 'You have failed to change clones before undocking.<br>Please be advised we believe you should change your clones due to your expensive implants.<br>Sincerely,<br>The Clone Saver Team';
$mail->recipient = (int)$self;
$mail->recipient_type = 'character';
//Dispatch the job
SendEveMail::dispatch($mail)->delay(Carbon::now()->addSeconds(1));
}
}

View File

@@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel
Commands\UpdateMoonPricing::class,
Commands\CalculateMarketTax::class,
Commands\holdingfinances::class,
Commands\RunCloneSaver::class,
];
/**
@@ -45,9 +44,6 @@ class Kernel extends ConsoleKernel
$schedule->command('services:calculatemarkettax')
->monthlyOn(1, '08:00')
->withoutOverlapping();
//$schedule->command('services:clonesaver')
// ->everyMinute()
// ->withoutOverlapping();
}
/**

View File

@@ -1,27 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Models\Esi\EsiScope;
use App\Models\Esi\EsiToken;
class CloneSaverController extends Controller
{
//Register display, this will register new scopes and the old scopes as well
public function displayRegister() {
}
//Remove display
public function removeRegister() {
}
//Display clones
public function displayClones() {
}
}

View File

@@ -47,7 +47,8 @@ class MoonsAdminController extends Controller
'date' => 'required'
]);
$date = strtotime($request->date . '00:00:01');
$date = new Carbon($request->date . '00:00:01');
//$date = strtotime($request->date . '00:00:01');
//Update the database entry
Moon::where([
'System' => $request->system,
@@ -137,7 +138,7 @@ class MoonsAdminController extends Controller
foreach($moons as $moon) {
//Setup formats as needed
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
$rentalEnd = date('m/d/Y', $moon->RentalEnd);
$rentalEnd = date('Y-m-d', $moon->RentalEnd);
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
//Add the data to the html string to be passed to the view

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Library\Moons;
use App\Models\Mail\EveMail;
class MoonMailer {
public function GetRentalMoons() {
}
public function TotalizeMoonCost($moons) {
}
public function SendMail($recipient, $moons, $dueDate) {
$body = '';
$mail = new EveMail;
$mail->sender = 93738489;
$mail->subject = 'Moon Rental';
$mail->body = $body;
$mail->recipient = (int)$recipient;
$mail->recipient_type = 'character';
$mail->save();
SendEveMail::dispatch($mail);
}
}
?>