rest_room.php 549 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class rest_room extends Model
  5. {
  6. //
  7. //便民设施序列化
  8. public function setServePeopleFacilityAttribute($serve_people_facility)
  9. {
  10. if (is_array($serve_people_facility)) {
  11. $this->attributes['serve_people_facility'] = json_encode($serve_people_facility);
  12. }
  13. }
  14. //便民设施序列化
  15. public function getServePeopleFacilityAttribute($serve_people_facility)
  16. {
  17. return json_decode($serve_people_facility, true);
  18. }
  19. }