'停车区', self::TYPE_NO_STOP_BIKE => '禁停区' ]; // 错误示例 // protected $parkingType = [1 => '禁停区', 2 => '停车区']; const STATUS_OK = 1; const STATUS_NO = 0; public static $statusMaps = [ self::STATUS_NO => '禁用', self::STATUS_OK => '启用', ]; protected $fillable = ['area_id', 'name', 'max_number', 'parking_fence', 'parking_centre', 'description', 'parking_radius', 'type', 'status']; public function getParkingCentreAttribute($value) { return toGaodeCentreData($value); } public function getWxParkingCentreAttribute() { return $this->attributes['parking_centre']; } public function getWxParkingFenceAttribute($value) { return $this->attributes['parking_fence']; } public function getParkingFenceAttribute($value) { return toGaodeFenceData($value); } public function setParkingCentreAttribute($value) { $this->attributes['parking_centre'] = latToLatitude($value); } public function setParkingFenceAttribute($value) { $this->attributes['parking_fence'] = latToLatitude($value); } public function area() { return $this->belongsTo(Area::class, 'area_id', 'id'); } }