|
|
@@ -41,6 +41,8 @@ class Order extends Model
|
|
|
'ready_to_mount',
|
|
|
];
|
|
|
|
|
|
+ public $appends = ['common_name'];
|
|
|
+
|
|
|
public function products_sku(): HasMany
|
|
|
{
|
|
|
return $this->hasMany(ProductSKU::class, 'order_id', 'id');
|
|
|
@@ -119,5 +121,12 @@ class Order extends Model
|
|
|
|
|
|
$this->update(['ready_to_mount' => ($result) ? 'Да' : 'Нет']);
|
|
|
}
|
|
|
+
|
|
|
+ public function commonName(): Attribute
|
|
|
+ {
|
|
|
+ return Attribute::make(
|
|
|
+ get: fn($value) => (string) $this->district->shortname . ', ' . $this->area->name . ', ' . $this->object_address,
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|