46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Real;
|
|
|
|
use App\Core\Model;
|
|
use App\Models\Real\Card;
|
|
|
|
class Order extends Model
|
|
{
|
|
protected $table = 'real_orders';
|
|
|
|
public $incrementing = false;
|
|
|
|
protected $dates = ['order_at', 'service_start_at', 'service_end_at'];
|
|
|
|
public function baseCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_base_cards', 'order_id', 'sim');
|
|
}
|
|
|
|
public function renewalCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_renewal_cards', 'order_id', 'sim');
|
|
}
|
|
|
|
public function renewalPackageCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_renewal_package_cards', 'order_id', 'sim');
|
|
}
|
|
|
|
public function flowPackageCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_flows_package_cards', 'order_id', 'sim');
|
|
}
|
|
|
|
public function optionalPackageCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_optional_package_cards', 'order_id', 'sim');
|
|
}
|
|
|
|
public function additionalPackageCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_additional_package_cards', 'order_id', 'sim');
|
|
}
|
|
}
|