You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.5 KiB
72 lines
1.5 KiB
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "s_d_y_middle".
|
|
*
|
|
* @property integer $id
|
|
* @property integer $series_id
|
|
* @property integer $displacement_id
|
|
* @property integer $year_id
|
|
* @property string $created_at
|
|
* @property string $updated_at
|
|
*/
|
|
class SDYMiddle extends \common\models\Base
|
|
{
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public static function tableName()
|
|
{
|
|
return 's_d_y_middle';
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['id'], 'required'],
|
|
[['id', 'series_id', 'displacement_id', 'year_id'], 'integer'],
|
|
[['created_at', 'updated_at'], 'safe'],
|
|
[['series_id','displacement_id','year_id'],'required']
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'id' => 'ID',
|
|
'series_id' => '车型',
|
|
'displacement_id' => '排量',
|
|
'year_id' => '年份',
|
|
'created_at' => 'Created At',
|
|
'updated_at' => 'Updated At',
|
|
];
|
|
}
|
|
/**
|
|
* @型号
|
|
*/
|
|
public function getSeriesT(){
|
|
return $this->hasOne(SeriesT::className(),['id'=>'series_id']);
|
|
}
|
|
/**
|
|
* @排量
|
|
*/
|
|
public function getDisplacementT(){
|
|
return $this->hasOne(DisplacementT::className(),['id'=>'displacement_id']);
|
|
}
|
|
/**
|
|
* @年份
|
|
*/
|
|
public function getYearT(){
|
|
return $this->hasOne(YearT::className(),['id'=>'year_id']);
|
|
}
|
|
}
|
|
|