MemberOpenId.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 用户openid表
  7. */
  8. class MemberOpenId extends Model
  9. {
  10. /**
  11. * The table associated with the model.
  12. *
  13. * @var string
  14. */
  15. protected $table = 'member_open_id';
  16. /**
  17. * The primary key associated with the table.
  18. *
  19. * @var string
  20. */
  21. protected $primaryKey = 'id';
  22. /**
  23. * Indicates if the model should be timestamped.
  24. *
  25. * @var bool
  26. */
  27. public $timestamps = true;
  28. /**
  29. * 不能被批量赋值的属性
  30. *
  31. * @var array
  32. */
  33. protected $guarded = ['id', 'updated_at', 'created_at'];
  34. private $typeEnum=[
  35. 1=>'微信H5',
  36. 2=>'微信小程序',
  37. 3=>'支付宝',
  38. ];
  39. /**
  40. * 为数组 / JSON 序列化准备日期。
  41. *
  42. * @param DateTimeInterface $date
  43. * @return string
  44. */
  45. protected function serializeDate(DateTimeInterface $date)
  46. {
  47. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  48. }
  49. }