Member.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 用户表
  7. *
  8. * @property int $id
  9. * @property string|null $phone 手机号码
  10. * @property string|null $nickname 昵称
  11. * @property string|null $head_img 头像
  12. * @property int|null $sex 性别
  13. * @property string|null $password 登录密码
  14. * @property string|null $encrypt 加密字符串
  15. * @property string|null $token_str token
  16. * @property string|null $money 余额
  17. * @property int|null $is_del 是否删除 0否 1是
  18. * @property \Illuminate\Support\Carbon|null $created_at
  19. * @property \Illuminate\Support\Carbon|null $updated_at
  20. * @method static \Illuminate\Database\Eloquent\Builder|Member newModelQuery()
  21. * @method static \Illuminate\Database\Eloquent\Builder|Member newQuery()
  22. * @method static \Illuminate\Database\Eloquent\Builder|Member query()
  23. * @method static \Illuminate\Database\Eloquent\Builder|Member whereCreatedAt($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|Member whereEncrypt($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|Member whereHeadImg($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|Member whereId($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder|Member whereIsDel($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMoney($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder|Member whereNickname($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder|Member wherePassword($value)
  31. * @method static \Illuminate\Database\Eloquent\Builder|Member wherePhone($value)
  32. * @method static \Illuminate\Database\Eloquent\Builder|Member whereSex($value)
  33. * @method static \Illuminate\Database\Eloquent\Builder|Member whereTokenStr($value)
  34. * @method static \Illuminate\Database\Eloquent\Builder|Member whereUpdatedAt($value)
  35. * @property int|null $main_id 主系统ID
  36. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMainId($value)
  37. * @mixin \Eloquent
  38. */
  39. class Member extends Model
  40. {
  41. /**
  42. * The table associated with the model.
  43. *
  44. * @var string
  45. */
  46. protected $table = 'member';
  47. /**
  48. * The primary key associated with the table.
  49. *
  50. * @var string
  51. */
  52. protected $primaryKey = 'id';
  53. /**
  54. * Indicates if the model should be timestamped.
  55. *
  56. * @var bool
  57. */
  58. public $timestamps = true;
  59. /**
  60. * 不能被批量赋值的属性
  61. *
  62. * @var array
  63. */
  64. protected $guarded = [ 'id', 'updated_at', 'created_at'];
  65. /**
  66. * 为数组 / JSON 序列化准备日期。
  67. *
  68. * @param DateTimeInterface $date
  69. * @return string
  70. */
  71. protected function serializeDate(DateTimeInterface $date)
  72. {
  73. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  74. }
  75. }