123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace Database\Seeders\Frontend;
- use Database\Seeders\BaseSeeder;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Hash;
- use Illuminate\Support\Str;
- use Txj\Elastic\Facades\Eav;
- use Txj\Elastic\Facades\ES;
- class UserAccountSeeder extends BaseSeeder
- {
- public function getColumnData()
- {
- return [
- 'user_id' => ['type' => 'uBigInt', 'title' => '用户id'],
- 'username' => ['type' => 'string_60', 'title' => '用户名'],
- 'mobile' => ['type' => 'string_60', 'title' => '手机号'],
- 'email' => ['type' => 'string_60', 'title' => '邮箱', 'is_null' => 1],
- 'password' => ['type' => 'string_60', 'title' => '密码'],
- 'retries' => ['type' => 'tinyInt', 'default' => 0, 'title' => '失败重试次数'],
- ];
- }
- /**
- * 初始化内容
- */
- public function init()
- {
- DB::table($this->schema)->insert([
- 'mid' => Str::random(12),
- 'created_at' => time(),
- 'updated_at' => time(),
- 'user_id' => 1,
- 'username' => 'tty',
- 'mobile' => '18260175830',
- 'email' => '597196313@qq.com',
- 'password' => Hash::make('asdfg1asdfg'),
- 'retries' => 1,
- ]);
- }
- /**
- * Run the database seeds.
- *
- * @return void
- */
- public function run()
- {
- $this->schema = 'user_account';
- $this->title = '用户表账号密码登录';
- $this->start();
- }
- }
|