41 lines
1023 B
PHP
41 lines
1023 B
PHP
<?php
|
|
|
|
namespace App\Models\Real;
|
|
|
|
use App\Core\Model;
|
|
use App\Models\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_card_relations', 'order_id', 'sim');
|
|
}
|
|
|
|
public function renewalCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_renewal_card_relations', 'order_id', 'sim');
|
|
}
|
|
|
|
public function flowCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_flows_card_relations', 'order_id', 'sim');
|
|
}
|
|
|
|
public function optionalCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_optional_card_relations', 'order_id', 'sim');
|
|
}
|
|
|
|
public function additionalCards()
|
|
{
|
|
return $this->belongsToMany(Card::class, 'real_order_additional_card_relations', 'order_id', 'sim');
|
|
}
|
|
}
|