You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
777 B

  1. <?php
  2. declare (strict_types=1);
  3. namespace App\Model\v3;
  4. /**
  5. */
  6. class UserRelationBind extends Model
  7. {
  8. /**
  9. * 社区服务点类型
  10. */
  11. const BIND_TYPE_COMMUNITY = 1;
  12. /**
  13. * The table associated with the model.
  14. *
  15. * @var string
  16. */
  17. protected $table = 'lanzu_user_relation_bind';
  18. /**
  19. * The attributes that are mass assignable.
  20. *
  21. * @var array
  22. */
  23. protected $fillable = ['bind_type', 'source_id', 'user_id', 'json_data'];
  24. /**
  25. * The attributes that should be cast to native types.
  26. *
  27. * @var array
  28. */
  29. protected $casts = [];
  30. public function setJsonDataAttribute($value)
  31. {
  32. $this->attributes['json_data'] = $value ? json_encode(json_decode($value, true)) : '';
  33. }
  34. }