refactor: 修改导航验证场景
This commit is contained in:
@@ -80,9 +80,15 @@ class NavigationItemValidate extends Validate
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 定义场景
|
// 新增场景
|
||||||
protected $scene = [
|
public function sceneAdd()
|
||||||
'add' => ['nav_id', 'pid', 'name', 'icon', 'link_type', 'link', 'sort', 'blank', 'status'],
|
{
|
||||||
'edit' => ['id', 'nav_id', 'pid', 'name', 'icon', 'link_type', 'link', 'sort', 'blank', 'status'],
|
return $this->only(['nav_id', 'pid', 'name', 'icon', 'link_type', 'link', 'sort', 'blank', 'status'])->remove('pid', 'different');
|
||||||
];
|
}
|
||||||
|
|
||||||
|
// 更新场景
|
||||||
|
public function sceneEdit()
|
||||||
|
{
|
||||||
|
return $this->only(['id', 'nav_id', 'pid', 'name', 'icon', 'link_type', 'link', 'sort', 'blank', 'status']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user