Files
usedcar/app/console/model/VehicleNewAttributeValuesModel.php
T

72 lines
1.4 KiB
PHP
Raw Normal View History

2025-06-17 15:54:24 +08:00
<?php
namespace app\console\model;
use support\Model;
/**
* VehicleNewAttributeValuesModel
*/
class VehicleNewAttributeValuesModel extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'hs_vehicle_new_attribute_values';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
/**
* 模型的数据字段的保存格式。
*
* @var string
*/
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'attribute_id', 'value_name', 'color_code', 'price_modifier', 'sort_order', 'created_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
/**
* 单条翻译
*/
public function translation()
{
return $this->hasOne(VehicleNewAttributeValuesTranslationModel::class, 'values_id')->where('locale', locale());
}
/**
* 多条翻译
*/
public function translations()
{
return $this->hasMany(VehicleNewAttributeValuesTranslationModel::class, 'values_id');
}
}