37 lines
836 B
PHP
37 lines
836 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class OfflineOrderItem extends Model
|
|
{
|
|
use HasFactory, HasDateTimeFormatter;
|
|
|
|
protected $attributes = [
|
|
'discount_reduction_amount' => 0,
|
|
'points_deduction_amount' => 0,
|
|
];
|
|
|
|
protected $fillable = [
|
|
'order_id',
|
|
'product_category_id',
|
|
'products_total_amount',
|
|
'discount_reduction_amount',
|
|
'points_deduction_amount',
|
|
'payment_amount',
|
|
];
|
|
|
|
public function order()
|
|
{
|
|
return $this->belongsTo(OfflineOrder::class, 'order_id');
|
|
}
|
|
|
|
public function productCategory()
|
|
{
|
|
return $this->belongsTo(OfflineProductCategory::class, 'product_category_id');
|
|
}
|
|
}
|