chinh sua theo tieu chuan phan mem BDS_1
This commit is contained in:
33
app/Models/SalesPhaseProduct.php
Normal file
33
app/Models/SalesPhaseProduct.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class SalesPhaseProduct extends Pivot
|
||||
{
|
||||
use HasUuids, HasFactory;
|
||||
|
||||
protected $table = 'sales_phase_products';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'sale_price' => 'decimal:2',
|
||||
'land_value' => 'decimal:2',
|
||||
'foundation_value' => 'decimal:2',
|
||||
'discount_details' => 'array',
|
||||
];
|
||||
|
||||
public function salesPhase()
|
||||
{
|
||||
return $this->belongsTo(SalesPhase::class);
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user