ErrorRecord.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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|null $m_id 会员ID
  10. * @property string $msg 错误说明
  11. * @property string $data 相关信息
  12. * @property \Illuminate\Support\Carbon|null $created_at
  13. * @property \Illuminate\Support\Carbon|null $updated_at
  14. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord newModelQuery()
  15. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord newQuery()
  16. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord query()
  17. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord whereCreatedAt($value)
  18. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord whereData($value)
  19. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord whereId($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord whereMId($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord whereMsg($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|ErrorRecord whereUpdatedAt($value)
  23. * @mixin \Eloquent
  24. */
  25. class ErrorRecord extends Model
  26. {
  27. /**
  28. * The table associated with the model.
  29. *
  30. * @var string
  31. */
  32. protected $table = 'error_records';
  33. /**
  34. * The primary key associated with the table.
  35. *
  36. * @var string
  37. */
  38. protected $primaryKey = 'id';
  39. /**
  40. * Indicates if the model should be timestamped.
  41. *
  42. * @var bool
  43. */
  44. public $timestamps = true;
  45. /**
  46. * 不能被批量赋值的属性
  47. *
  48. * @var array
  49. */
  50. protected $guarded = ['id', 'updated_at', 'created_at'];
  51. /**
  52. * 为数组 / JSON 序列化准备日期。
  53. *
  54. * @param DateTimeInterface $date
  55. * @return string
  56. */
  57. protected function serializeDate(DateTimeInterface $date)
  58. {
  59. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  60. }
  61. }