当前位置:Gxlcms >
数据库问题 >
yii\rbac\DbManager:addItem($item) 插入auth_item权限项目表 设置时间
yii\rbac\DbManager:addItem($item) 插入auth_item权限项目表 设置时间
时间:2021-07-01 10:21:17
帮助过:15人阅读
function addItem(
$item)
{
$time =
time();
if (
$item->createdAt ===
null) {
$item->createdAt =
$time;
}
if (
$item->updatedAt ===
null) {
$item->updatedAt =
$time;
}
$this->db->
createCommand()
->insert(
$this->itemTable,
[ //auth_item
‘name‘ =>
$item->name,
‘type‘ =>
$item->type,
‘description‘ =>
$item->description,
‘rule_name‘ =>
$item->ruleName,
‘data‘ =>
$item->data ===
null ?
null :
serialize(
$item->data),
‘created_at‘ =>
$item->createdAt,
‘updated_at‘ =>
$item->updatedAt,
])->
execute();
$this->
invalidateCache();
return true;
}
yii\rbac\DbManager:addItem($item) 插入auth_item权限项目表 设置时间
标签:creat protected blog desc validate bsp cti serialize manager