* Fix details.

This commit is contained in:
孙广明
2021-09-09 09:55:03 +08:00
parent 2f192ff299
commit 0b3309033f
+6 -3
View File
@@ -739,9 +739,12 @@ class programModel extends model
$this->processNode($programID, $program->parent, $oldProgram->path, $oldProgram->grade);
/* Move product to new top program. */
$oldTopProgram = $this->getTopByPath($oldProgram->path);
$newTopProgram = $this->getTopByID($programID);
if($oldTopProgram != $newTopProgram) $this->dao->update(TABLE_PRODUCT)->set('program')->eq($newTopProgram)->where('program')->eq($oldTopProgram)->exec();
if($oldProgram->parent == 0)
{
$oldTopProgram = $this->getTopByPath($oldProgram->path);
$newTopProgram = $this->getTopByID($programID);
if($oldTopProgram != $newTopProgram) $this->dao->update(TABLE_PRODUCT)->set('program')->eq($newTopProgram)->where('program')->eq($oldTopProgram)->exec();
}
}
return common::createChanges($oldProgram, $program);