cleaning stale data console command modified
This commit is contained in:
@@ -2,9 +2,18 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
//Library
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\Lookups\AllianceLookup;
|
||||
use App\Models\Lookups\CharacterLookup;
|
||||
use App\Models\Lookups\CorporationLookup;
|
||||
use App\Models\Lookups\ItemLookup;
|
||||
|
||||
class CleanStaleDataCommand extends Command
|
||||
{
|
||||
/**
|
||||
@@ -40,5 +49,17 @@ class CleanStaleDataCommand extends Command
|
||||
{
|
||||
$command = new CommandHelper;
|
||||
$command->CleanJobStatusTable();
|
||||
|
||||
//Empty the item lookup table
|
||||
ItemLookup::truncate();
|
||||
|
||||
//Empty the character lookup table
|
||||
CharacterLookup::truncate();
|
||||
|
||||
//Empty the corporation lookup table
|
||||
CorporationLookup::truncate();
|
||||
|
||||
//Empty the alliance lookup table
|
||||
AllianceLookup::truncate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ use App\Models\Esi\EsiToken;
|
||||
use App\Models\Esi\EsiScope;
|
||||
use App\Models\Structure\Structure;
|
||||
use App\Models\Structure\Service;
|
||||
use App\Models\Lookups\Item;
|
||||
use App\Models\Lookups\ItemLookup;
|
||||
|
||||
class MoonLedgerController extends Controller
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ use App\Models\Lookups\CharacterLookup;
|
||||
use App\Models\Lookups\CorporationLookup;
|
||||
use App\Models\Lookups\AllianceLookup;
|
||||
use App\Models\Lookups\SolarSystem;
|
||||
use App\Models\Lookups\Item;
|
||||
use App\Models\Lookups\ItemLookup;
|
||||
|
||||
class NewLookupHelper {
|
||||
|
||||
@@ -61,7 +61,7 @@ class NewLookupHelper {
|
||||
}
|
||||
|
||||
private function LookupItem($itemId) {
|
||||
$item = Item::where([
|
||||
$item = ItemLookup::where([
|
||||
'type_id' => $itemId,
|
||||
])->first();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Models\Lookups;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Item extends Model
|
||||
class ItemLookup extends Model
|
||||
{
|
||||
/**
|
||||
* Table Name
|
||||
Reference in New Issue
Block a user