Member.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. * @mixin \Eloquent
  36. */
  37. class Member extends Model
  38. {
  39. /**
  40. * The table associated with the model.
  41. *
  42. * @var string
  43. */
  44. protected $table = 'member';
  45. /**
  46. * The primary key associated with the table.
  47. *
  48. * @var string
  49. */
  50. protected $primaryKey = 'id';
  51. /**
  52. * Indicates if the model should be timestamped.
  53. *
  54. * @var bool
  55. */
  56. public $timestamps = true;
  57. /**
  58. * 不能被批量赋值的属性
  59. *
  60. * @var array
  61. */
  62. protected $guarded = [ 'id', 'updated_at', 'created_at'];
  63. /**
  64. * 为数组 / JSON 序列化准备日期。
  65. *
  66. * @param DateTimeInterface $date
  67. * @return string
  68. */
  69. protected function serializeDate(DateTimeInterface $date)
  70. {
  71. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  72. }
  73. }