初始化仓库
This commit is contained in:
79
common/modelsgii/Admin.php
Normal file
79
common/modelsgii/Admin.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace common\modelsgii;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "yii2_admin".
|
||||
*
|
||||
* @property int $uid 用户ID
|
||||
* @property string $username 用户名
|
||||
* @property string $password 密码
|
||||
* @property int|null $role 角色1为官方管理
|
||||
* @property int|null $mall_id 商城ID
|
||||
* @property string|null $salt 密码干扰字符
|
||||
* @property string|null $email 用户邮箱
|
||||
* @property string $mobile 用户手机
|
||||
* @property int $reg_time 注册时间
|
||||
* @property int $reg_ip 注册IP
|
||||
* @property string $code 业务员推广码
|
||||
* @property int $last_login_time 最后登录时间
|
||||
* @property int $last_login_ip 最后登录IP
|
||||
* @property int $update_time 更新时间
|
||||
* @property int|null $is_sub 是否子账号
|
||||
* @property int|null $is_delete 是否删除
|
||||
* @property int|null $status 用户状态 1正常 0禁用
|
||||
*/
|
||||
class Admin extends \common\core\BaseActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return '{{%admin}}';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['username', 'password'], 'required'],
|
||||
[['role', 'mall_id', 'reg_time', 'reg_ip', 'last_login_time', 'last_login_ip', 'update_time', 'is_sub', 'is_delete', 'status'], 'integer'],
|
||||
[['username'], 'string', 'max' => 16],
|
||||
[['password'], 'string', 'max' => 60],
|
||||
[['salt', 'email'], 'string', 'max' => 32],
|
||||
[['mobile'], 'string', 'max' => 15],
|
||||
[['code'], 'string', 'max' => 30],
|
||||
[['mobile','code'], 'unique'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'uid' => 'Uid',
|
||||
'username' => 'Username',
|
||||
'password' => 'Password',
|
||||
'role' => 'Role',
|
||||
'mall_id' => 'Mall ID',
|
||||
'salt' => 'Salt',
|
||||
'email' => 'Email',
|
||||
'mobile' => 'Mobile',
|
||||
'reg_time' => 'Reg Time',
|
||||
'reg_ip' => 'Reg Ip',
|
||||
'last_login_time' => 'Last register Time',
|
||||
'last_login_ip' => 'Last register Ip',
|
||||
'update_time' => 'Update Time',
|
||||
'is_sub' => 'Is Sub',
|
||||
'is_delete' => 'Is Delete',
|
||||
'status' => 'Status',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user