* Modify module update.

This commit is contained in:
caoyanyi
2023-03-27 13:52:23 +08:00
parent 3c24f9b54d
commit 4712c71163
+1 -1
View File
@@ -2362,6 +2362,7 @@ class treeModel extends model
$parent = $this->getByID($module->parent);
$module->grade = $module->parent ? $parent->grade + 1 : 1;
$this->dao->insert(TABLE_MODULE)->data($module)->exec();
$moduleID = $this->dao->lastInsertID();
if($data->createType == 'same')
{
@@ -2377,7 +2378,6 @@ class treeModel extends model
$module->order += 10;
}
$moduleID = $this->dao->lastInsertID();
$modulePath = "$moduleID,";
if($module->parent) $modulePath = $parent->path . $modulePath;
$this->dao->update(TABLE_MODULE)->set('`path`')->eq($modulePath)->set('`order`')->eq($module->order)->where('id')->eq($moduleID)->limit(1)->exec();