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.

41 lines
799 B

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