62 lines
1.4 KiB
PHP
62 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace app\models;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "{{%detection}}".
|
|
*
|
|
* @property int $id
|
|
* @property string $name 检测员名称
|
|
* @property int $store_id 门店id
|
|
* @property int $user_id 用户id
|
|
* @property int|null $created_at
|
|
* @property int|null $updated_at
|
|
* @property int|null $is_delete
|
|
* @property int|null $deleted_at
|
|
*/
|
|
class Detection extends \yii\db\ActiveRecord
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function tableName()
|
|
{
|
|
return '{{%detection}}';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['store_id', 'user_id', 'created_at', 'updated_at', 'is_delete', 'deleted_at'], 'integer'],
|
|
[['name'], 'string', 'max' => 50],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'id' => 'ID',
|
|
'name' => '检测员名称',
|
|
'store_id' => '门店id',
|
|
'user_id' => '用户id',
|
|
'created_at' => 'Created At',
|
|
'updated_at' => 'Updated At',
|
|
'is_delete' => 'Is Delete',
|
|
'deleted_at' => 'Deleted At',
|
|
];
|
|
}
|
|
|
|
public function getUser()
|
|
{
|
|
return $this->hasOne(User::className(), ['id' => 'user_id'])->where(['is_delete' => 0]);
|
|
}
|
|
}
|