Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\EcommerceFinance\Models;
|
|
|
|
use App\Abstracts\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Order extends Model
|
|
{
|
|
protected $table = 'ec_orders';
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'store_id',
|
|
'external_order_id',
|
|
'order_status',
|
|
'ordered_at',
|
|
'paid_at',
|
|
'shipped_at',
|
|
'completed_at',
|
|
'currency_code',
|
|
'gross_amount',
|
|
'buyer_paid_amount',
|
|
'platform_subsidy_amount',
|
|
'merchant_subsidy_amount',
|
|
'refunded_amount',
|
|
'payload',
|
|
'created_by',
|
|
'created_from',
|
|
];
|
|
|
|
protected $casts = [
|
|
'ordered_at' => 'datetime',
|
|
'paid_at' => 'datetime',
|
|
'shipped_at' => 'datetime',
|
|
'completed_at' => 'datetime',
|
|
'payload' => 'array',
|
|
];
|
|
|
|
public function store(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Store::class);
|
|
}
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(OrderItem::class);
|
|
}
|
|
|
|
public function events(): HasMany
|
|
{
|
|
return $this->hasMany(OrderEvent::class);
|
|
}
|
|
}
|