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

28 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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);
}
}