28 lines
1.5 KiB
PHP
28 lines
1.5 KiB
PHP
<?php
|
||
|
||
namespace Database\Seeders;
|
||
|
||
use Illuminate\Database\Seeder;
|
||
use App\Models\{Vip, UserVip};
|
||
|
||
class VipsTableSeeder extends Seeder
|
||
{
|
||
/**
|
||
* Run the database seeds.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function run()
|
||
{
|
||
Vip::truncate();
|
||
UserVip::truncate();
|
||
$time = now();
|
||
$list = [
|
||
['name' => '年卡', 'times' => json_encode(['text' => '1年', 'num' => 1, 'unit' => 'year']), 'price' => 100, 'description' => '瞰澜书店年卡'.PHP_EOL.'咖啡饮品85折,图书85折,免费咖啡饮品40杯;'.PHP_EOL.'生日礼物惊喜图书一本;'.PHP_EOL.'通用现金券500元(有限期365天)', 'created_at' => $time, 'updated_at' => $time],
|
||
['name' => '季卡', 'times' => json_encode(['text' => '3月', 'num' => 3, 'unit' => 'month']), 'price' => 25, 'description' => '瞰澜书店季卡'.PHP_EOL.'咖啡饮品85折,图书85折,免费咖啡饮品40杯;'.PHP_EOL.'生日礼物惊喜图书一本;'.PHP_EOL.'通用现金券500元(有限期365天)', 'created_at' => $time, 'updated_at' => $time],
|
||
['name' => '月卡', 'times' => json_encode(['text' => '1月', 'num' => 1, 'unit' => 'month']), 'price' => 10, 'description' => '瞰澜书店月卡'.PHP_EOL.'咖啡饮品85折,图书85折,免费咖啡饮品40杯;'.PHP_EOL.'生日礼物惊喜图书一本;'.PHP_EOL.'通用现金券500元(有限期365天)', 'created_at' => $time, 'updated_at' => $time],
|
||
];
|
||
Vip::insert($list);
|
||
}
|
||
}
|