Initial commit,修正
This commit is contained in:
Executable
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @Author: fm453
|
||||
* @Date: 2021-09-10 17:34:17
|
||||
* @Last Modified by: fm453
|
||||
* @Last Modified time: 2021-09-10 17:34:25
|
||||
* @Email: fm453@lukegzs.com
|
||||
*/
|
||||
namespace backend\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "auth_assignment".
|
||||
*
|
||||
* @property string $item_name
|
||||
* @property string $user_id
|
||||
* @property integer $created_at
|
||||
*
|
||||
* @property AuthItem $itemName
|
||||
*/
|
||||
class AuthAssignment extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return '{{%auth_assignment}}';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['item_name', 'user_id'], 'required'],
|
||||
[['created_at'], 'integer'],
|
||||
[['item_name', 'user_id'], 'string', 'max' => 64],
|
||||
[['item_name'], 'exist', 'skipOnError' => true, 'targetClass' => AuthItem::className(), 'targetAttribute' => ['item_name' => 'name']],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'item_name' => 'Item Name',
|
||||
'user_id' => 'User ID',
|
||||
'created_at' => 'Created At',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getItemName()
|
||||
{
|
||||
return $this->hasOne(AuthItem::className(), ['name' => 'item_name']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user