43 lines
1021 B
PHP
43 lines
1021 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\AdminUser;
|
|
use App\Models\RiceShrimpIndustry;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class RiceShrimpIndustrySeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$tz = now();
|
|
|
|
$values = [];
|
|
|
|
$admin = AdminUser::firstOrFail();
|
|
|
|
foreach ([2020, 2021, 2022] as $year) {
|
|
foreach ([1, 2, 3, 4] as $quarter) {
|
|
$values[] = [
|
|
'year' => $year,
|
|
'quarter' => $quarter,
|
|
'area' => mt_rand(100, 200),
|
|
'product_output' => mt_rand(400, 600),
|
|
'product_value' => mt_rand(200, 300),
|
|
'created_by' => $admin->id,
|
|
'updated_by' => $admin->id,
|
|
'created_at' => $tz,
|
|
'updated_at' => $tz,
|
|
];
|
|
}
|
|
}
|
|
|
|
RiceShrimpIndustry::insert($values);
|
|
}
|
|
}
|