UserModel.php 714 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\model;
  4. use think\Model;
  5. /**
  6. * 用户模型
  7. */
  8. class UserModel extends Model
  9. {
  10. // 设置表名
  11. protected $name = 'user';
  12. // 设置主键
  13. protected $pk = 'user_id';
  14. // 设置自动时间戳
  15. protected $autoWriteTimestamp = 'int';
  16. // 设置字段类型
  17. protected $type = [
  18. 'user_id' => 'int',
  19. 'user_name' => 'string',
  20. 'password' => 'string',
  21. 'user_role' => 'int',
  22. 'merchant_id' => 'int',
  23. 'phone' => 'string',
  24. 'nick_name' => 'string',
  25. 'white_list_ip' => 'string',
  26. 'create_time' => 'int',
  27. 'login_time' => 'int',
  28. 'update_time' => 'int',
  29. ];
  30. }