MainMemberOpenId.php 1.1 KB

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