MainMemberOpenId.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace App\Models\Main;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * App\Models\Main\MainMemberOpenId
  7. *
  8. * @property int $id
  9. * @property int $m_id 会员ID
  10. * @property string $openid 公众号id
  11. * @property string $unopenid 公众号唯一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. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId newModelQuery()
  16. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId newQuery()
  17. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId query()
  18. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereCreatedAt($value)
  19. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereId($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereMId($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereOpenid($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereType($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereUnopenid($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|MainMemberOpenId whereUpdatedAt($value)
  25. * @mixin \Eloquent
  26. */
  27. class MainMemberOpenId extends Model
  28. {
  29. protected $connection = 'mysqlTwo';
  30. /**
  31. * The table associated with the model.
  32. *
  33. * @var string
  34. */
  35. protected $table = 'member_open_ids';
  36. /**
  37. * The primary key associated with the table.
  38. *
  39. * @var string
  40. */
  41. protected $primaryKey = 'id';
  42. /**
  43. * Indicates if the model should be timestamped.
  44. *
  45. * @var bool
  46. */
  47. public $timestamps = true;
  48. /**
  49. * 不能被批量赋值的属性
  50. *
  51. * @var array
  52. */
  53. protected $guarded = ['id', 'updated_at', 'created_at'];
  54. private $typeEnum=[
  55. 1=>'微信H5',
  56. 2=>'微信小程序',
  57. 3=>'支付宝',
  58. 4=>'点餐小程序',
  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. }