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/AppointmentT.php

80 lines
1.8 KiB

5 years ago
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "appointment_t".
*
* @property integer $id
* @property integer $car_id
* @property integer $user_id
* @property string $pdate
* @property string $ptime
* @property integer $ptype
* @property string $remark
* @property integer $is_first
* @property string $created_at
* @property string $updated_at
*/
class AppointmentT extends \common\models\Base
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'appointment_t';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['car_id','user_id'], 'required'],
[['car_id','user_id','is_first','ptype','business_group_id'], 'integer'],
[['created_at', 'updated_at'], 'safe'],
[['pdate', 'ptime'], 'string', 'max' => 50],
[['remark'], 'string', 'max' => 500],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'car_id' => 'Car ID',
'user_id' => 'User ID',
'pdate' => 'Pdate',
'ptime' => 'Ptime',
'ptype' => 'Ptype',
'remark' => 'Remark',
'is_first' => 'Is First',
'business_group_id' => 'Business Group Id',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
public function getCar()
{
return $this->hasOne(CarT::className(),['id'=>'car_id']);
}
public function getUser()
{
return $this->hasOne(UserT::className(),['id'=>'user_id']);
}
public function getBusinessGroup()
{
return $this->hasOne(BusinessGroupT::className(), ['id' => 'business_group_id']);
}
}