UserModel.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * 用户模型.
  4. *
  5. * @author jim <jim458734573@gmail.com>
  6. * @date 2020-01-10 21:03:42
  7. */
  8. declare(strict_types=1);
  9. namespace App\Model;
  10. class UserModel extends BaseModel
  11. {
  12. /**
  13. * 表名.
  14. *
  15. * @var string
  16. */
  17. protected $table = 'user';
  18. /**
  19. * 每个字段格式化数据类型.
  20. *
  21. * @var array
  22. */
  23. protected $casts = [
  24. 'id' => 'integer',
  25. 'created_at' => 'string',
  26. 'updated_at' => 'string',
  27. 'nick' => 'string',
  28. 'intro' => 'string',
  29. 'locked_at' => 'string',
  30. 'parent_uid' => 'string',
  31. 'region_code' => 'string',
  32. 'mobile' => 'string',
  33. 'avatar_path' => 'string',
  34. 'coins' => 'integer',
  35. 'balance' => 'float',
  36. 'birth' => 'string',
  37. 'gender' => 'integer',
  38. 'status' => 'integer',
  39. 'ip' => 'string',
  40. 'code' => 'string',
  41. 'last_login_at' => 'string',
  42. 'device_no' => 'string',
  43. 'device_type' => 'string',
  44. 'channel_id' => 'string',
  45. 'max_view' => 'integer',
  46. 'viewed_num' => 'integer',
  47. 'vip_expired' => 'string',
  48. 'finger' => 'string',
  49. 'bg_cover' => 'string',
  50. 'live_code' => 'string',
  51. ];
  52. }