MemberOpenId.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 用户openid表
  7. *
  8. * @property int $id
  9. * @property int $m_id 会员ID
  10. * @property string $openid 公众号id
  11. * @property string|null $unionid 公众号唯一ID
  12. * @property int $type 平台类型:1:微信,2:小程序,3:支付宝
  13. * @property \Illuminate\Support\Carbon|null $created_at
  14. * @property \Illuminate\Support\Carbon|null $updated_at
  15. * @property int|null $is_del
  16. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId newModelQuery()
  17. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId newQuery()
  18. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId query()
  19. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereCreatedAt($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereId($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereIsDel($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereMId($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereOpenid($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereType($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereUnionid($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|MemberOpenId whereUpdatedAt($value)
  27. * @mixin \Eloquent
  28. */
  29. class MemberOpenId extends Model
  30. {
  31. /**
  32. * The table associated with the model.
  33. *
  34. * @var string
  35. */
  36. protected $table = 'member_open_id';
  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. private $typeEnum=[
  56. 1=>'微信H5',
  57. 2=>'微信小程序',
  58. 3=>'支付宝',
  59. ];
  60. /**
  61. * 为数组 / JSON 序列化准备日期。
  62. *
  63. * @param DateTimeInterface $date
  64. * @return string
  65. */
  66. protected function serializeDate(DateTimeInterface $date)
  67. {
  68. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  69. }
  70. }