AgentMobileSmsSeeder.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Database\Seeders\Agent;
  3. use Database\Seeders\BaseSeeder;
  4. use Illuminate\Support\Facades\DB;
  5. use Illuminate\Support\Facades\Hash;
  6. use Illuminate\Support\Str;
  7. use Txj\Elastic\Facades\Eav;
  8. use Txj\Elastic\Facades\ES;
  9. class AgentMobileSmsSeeder extends BaseSeeder
  10. {
  11. public function getColumnData()
  12. {
  13. return [
  14. 'user_id' => ['type' => 'uBigInt', 'title' => '用户id'],
  15. 'prefix' => ['type' => 'string_60', 'title' => '手机号前缀'],
  16. 'mobile' => ['type' => 'string_60', 'title' => '手机号'],
  17. 'sms_yzm' => ['type' => 'string_60', 'title' => '短信验证码'],
  18. 'retries' => ['type' => 'tinyInt', 'default' => 0, 'title' => '失败重试次数'],
  19. ];
  20. }
  21. /**
  22. * 初始化内容
  23. */
  24. public function init()
  25. {
  26. DB::table($this->schema)->insert([
  27. 'mid' => Str::random(12),
  28. 'user_id' => 1,
  29. 'prefix' => '+86',
  30. 'mobile' => '18260175830',
  31. 'sms_yzm' => '',
  32. 'retries' => 1,
  33. 'created_at' => time(),
  34. 'updated_at' => time()
  35. ]);
  36. }
  37. /**
  38. * Run the database seeds.
  39. *
  40. * @return void
  41. */
  42. public function run()
  43. {
  44. $this->schema = 'agent_mobile_sms';
  45. $this->title = '代理商手机短信验证码登录表';
  46. $this->start();
  47. }
  48. }