Files
usedcar/app/apis/model/VehicleNewSkuAttributesModel.php
T
2025-06-18 14:05:52 +08:00

71 lines
1.4 KiB
PHP

<?php
namespace app\apis\model;
use support\Model;
/**
* VehicleNewSkuAttributesModel
*/
class VehicleNewSkuAttributesModel 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_sku_attributes';
/**
* 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', 'sku_id', 'attribute_id', 'value_id', 'img', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
public function attribute()
{
return $this->belongsTo(VehicleNewAttributesModel::class, 'attribute_id', 'id');
}
public function value()
{
return $this->belongsTo(VehicleNewAttributeValuesModel::class, 'value_id', 'id');
}
public function skuAttributes()
{
return $this->belongsTo(VehicleNewSkusModel::class, 'sku_id', 'id');
}
}