refactor(admin): remove unused 'where' option in system module
- Remove unnecessary 'where' option from various models in system module - Simplify query methods by removing redundant 'where' calls - Affected models: Config, Node, SystemAdmin, SystemMenu, SystemNode
This commit is contained in:
@@ -58,11 +58,11 @@ class Node extends AdminController
|
||||
|
||||
try {
|
||||
if ($force == 1) {
|
||||
$updateNodeList = $model->removeOption('where')->whereIn('node', array_column($nodeList, 'node'))->select();
|
||||
$updateNodeList = $model->removeOption()->whereIn('node', array_column($nodeList, 'node'))->select();
|
||||
$formatNodeList = array_format_key($nodeList, 'node');
|
||||
foreach ($updateNodeList as $vo) {
|
||||
isset($formatNodeList[$vo['node']])
|
||||
&& $model->removeOption('where')->where('id', $vo['id'])->update(
|
||||
&& $model->removeOption()->where('id', $vo['id'])->update(
|
||||
[
|
||||
'title' => $formatNodeList[$vo['node']]['title'],
|
||||
'is_auth' => $formatNodeList[$vo['node']]['is_auth'],
|
||||
@@ -70,7 +70,7 @@ class Node extends AdminController
|
||||
);
|
||||
}
|
||||
}
|
||||
$existNodeList = $model->removeOption('where')->field('node,title,type,is_auth')->select();
|
||||
$existNodeList = $model->removeOption()->field('node,title,type,is_auth')->select();
|
||||
foreach ($nodeList as $key => $vo) {
|
||||
foreach ($existNodeList as $v) {
|
||||
if ($vo['node'] == $v->node) {
|
||||
|
||||
Reference in New Issue
Block a user