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.
 
 
 
 
simple-yewu/common/models/FixCarJidian.php

75 lines
1.8 KiB

<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "fix_car_jidian".
*
* @property integer $id
* @property string $price
* @property integer $project_id
* @property integer $car_price_id
* @property string $created_at
* @property string $updated_at
*
* @property FixCarPrice $carPrice
* @property FixCarProject $project
*/
class FixCarJidian extends \common\models\Base
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'fix_car_jidian';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['price'], 'number'],
[['project_id'], 'required'],
[['project_id', 'car_price_id'], 'integer'],
[['created_at', 'updated_at'], 'safe'],
[['car_price_id'], 'exist', 'skipOnError' => true, 'targetClass' => FixCarPrice::className(), 'targetAttribute' => ['car_price_id' => 'id']],
[['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => FixCarProject::className(), 'targetAttribute' => ['project_id' => 'id']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'price' => 'Price',
'project_id' => 'Project ID',
'car_price_id' => 'Car Price ID',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCarPrice()
{
return $this->hasOne(FixCarPrice::className(), ['id' => 'car_price_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProject()
{
return $this->hasOne(FixCarProject::className(), ['id' => 'project_id']);
}
}