41 lines
990 B
PHP
41 lines
990 B
PHP
<?php
|
|
|
|
namespace Koneko\VuexyStoreManager\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Currency extends Model
|
|
{
|
|
const STATUS_ENABLED = 10;
|
|
const STATUS_DISABLED = 1;
|
|
const STATUS_REMOVED = 0;
|
|
|
|
protected $fillable = [
|
|
'c_currency',
|
|
'symbol',
|
|
'used_in_purchases',
|
|
'used_in_sales',
|
|
'used_in_ecommerce',
|
|
'main_currency',
|
|
'auto_update_exchange_rates',
|
|
'update_interval',
|
|
'status'
|
|
];
|
|
|
|
protected $casts = [
|
|
'used_in_purchases' => 'boolean',
|
|
'used_in_sales' => 'boolean',
|
|
'used_in_ecommerce' => 'boolean',
|
|
'main_currency' => 'boolean',
|
|
'auto_update_exchange_rates' => 'boolean',
|
|
'update_interval' => 'integer',
|
|
'status' => 'integer',
|
|
];
|
|
|
|
// Relación con el historial de tipos de cambio
|
|
public function exchangeRates()
|
|
{
|
|
return $this->hasMany(CurrencyExchangeRate::class, 'c_currency', 'c_currency');
|
|
}
|
|
}
|