import moons

This commit is contained in:
2021-05-30 18:08:54 +09:00
parent b94c39923f
commit a715a7c022
3 changed files with 24 additions and 4 deletions

View File

@@ -74,13 +74,33 @@ class ImportAllianceMoons extends Command
$moons->push($separated);
}
/**
* The first pass through the collection of data is to get all of the ore data
* and store it in the database. From the database moon ore, we will create a list
* of moons and store those in the database. After the list of moons are created in the
* database, the function will then update the value of all the moons.
*/
//Start working our way through all of the moons
//and saving the data to the database
foreach($moons as $moon) {
//Declare variables for each instance of the foreach loop
$moonId = null;
$moonName = null;
$oreId = null;
$oreName = null;
$oreQuantity = null;
$systemId = null;
$systemname = null;
if($moon[0] != null) {
//Test print
printf($moon[0] . "\r\n");
//Do nothing
} else {
for($i = 0; $i < sizeof($moon[0]; $i++)) {
var_dump($moon[0]);
}
}
}
dd();

View File

@@ -28,7 +28,7 @@ class AllianceMoonOre extends Model
*/
protected $fillable = [
'moon_id',
'name',
'moon_name',
'ore_type_id',
'ore_name',
];

View File

@@ -48,7 +48,7 @@ class CreateNewMoonRentalTables extends Migration
Schema::create('alliance_moons', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('moon_id');
$table->string('name');
$table->string('moon_name');
$table->unsignedBigInteger('ore_type_id');
$table->string('ore_name');
});