MemberLog.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 会员日志
  7. *
  8. * @property int $id
  9. * @property int $m_id 会员ID
  10. * @property string $msg 操作说明
  11. * @property string $url 请求地址
  12. * @property string $ip 访问IP
  13. * @property string|null $data 请求内容
  14. * @property \Illuminate\Support\Carbon|null $created_at
  15. * @property \Illuminate\Support\Carbon|null $updated_at
  16. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog newModelQuery()
  17. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog newQuery()
  18. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog query()
  19. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereCreatedAt($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereData($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereId($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereIp($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereMId($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereMsg($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereUpdatedAt($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|MemberLog whereUrl($value)
  27. * @mixin \Eloquent
  28. */
  29. class MemberLog extends Model
  30. {
  31. /**
  32. * The table associated with the model.
  33. *
  34. * @var string
  35. */
  36. protected $table = 'member_logs';
  37. /**
  38. * The primary key associated with the table.
  39. *
  40. * @var string
  41. */
  42. protected $primaryKey = 'id';
  43. /**
  44. * Indicates if the model should be timestamped.
  45. *
  46. * @var bool
  47. */
  48. public $timestamps = true;
  49. /**
  50. * 不能被批量赋值的属性
  51. *
  52. * @var array
  53. */
  54. protected $guarded = ['id', 'updated_at', 'created_at'];
  55. /**
  56. * 为数组 / JSON 序列化准备日期。
  57. *
  58. * @param DateTimeInterface $date
  59. * @return string
  60. */
  61. protected function serializeDate(DateTimeInterface $date)
  62. {
  63. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  64. }
  65. }