6
0
Fork 0
jiqu-library-server/database/seeders/ShippingSeeder.php

29 lines
625 B
PHP

<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\{ShippingTemplate, ShippingRule, Zone};
class ShippingSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$template = ShippingTemplate::create([
'name' => '自提'
]);
ShippingRule::create([
'template_id' => $template->id,
'type' => 1,
'info' => json_encode(["threshold" => "100"]),
'zones' => json_encode(Zone::where('type', Zone::TYPE_AREA)->pluck('id')),
]);
}
}