'未绑定', self::BINDING_YES => '已绑定', ]; const TBT = 1; const WKM = 2; public static $manufacturerMaps = [ self::TBT => '泰比特', self::WKM => '威科姆', ]; public function getBlekgAttribute($value) { if ($value == 1) { return true; } else { return false; } } public function setBlekgAttribute($value) { $this->attributes['blekg'] = $value ? 1 : 0; } public function bikes() { return $this->belongsTo(Bike::class, 'box_no', 'box_no'); } public function updateBox($box_no, $data) { return $this->query()->where('box_no', $box_no)->update($data); } }