update Area + Device
This commit is contained in:
54
models/Area.php
Normal file
54
models/Area.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "area".
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $code
|
||||
* @property int $pid
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property int $created_at
|
||||
* @property int $modified_at
|
||||
*/
|
||||
class Area extends \yii\db\ActiveRecord {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName() {
|
||||
return 'area';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
[['code', 'name'], 'required'],
|
||||
[['code', 'pid', 'created_at', 'modified_at'], 'integer'],
|
||||
[['description'], 'string'],
|
||||
[['name'], 'string', 'max' => 100],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels() {
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'code' => 'Mã khu vực',
|
||||
'pid' => 'Khu vực cha',
|
||||
'name' => 'Tên khu vực',
|
||||
'description' => 'Chú thích',
|
||||
'created_at' => 'Thời gian tạo',
|
||||
'modified_at' => 'Thời gian sửa',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user