refactor: 修改导航验证场景
This commit is contained in:
@@ -80,9 +80,15 @@ class NavigationItemValidate extends Validate
|
||||
return true;
|
||||
}
|
||||
|
||||
// 定义场景
|
||||
protected $scene = [
|
||||
'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'],
|
||||
];
|
||||
// 新增场景
|
||||
public function sceneAdd()
|
||||
{
|
||||
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