improve migration file + seedbox management

This commit is contained in:
xiaomlove
2022-07-21 15:42:12 +08:00
parent b2e3c2cce3
commit b507c41bf0
33 changed files with 577 additions and 12 deletions
+12 -6
View File
@@ -232,9 +232,12 @@ class Update extends Install
$table = 'sysoppanel';
$this->addMenu($table, $menus);
$menuToDel = ['amountupload.php', 'amountattendancecard.php', 'amountbonus.php', 'deletedisabled.php'];
$this->removeMenu('sysoppanel', $menuToDel);
$this->removeMenu('adminpanel', $menuToDel);
$this->removeMenu('modpanel', $menuToDel);
$this->removeMenu($menuToDel);
/**
* @since 1.7.19
*/
$this->removeMenu(['freeleech.php']);
}
@@ -271,10 +274,13 @@ class Update extends Install
}
}
private function removeMenu($table, array $menus)
private function removeMenu(array $menus, array $tables = ['sysoppanel', 'adminpanel', 'modpanel'])
{
foreach ($menus as $menu) {
NexusDB::delete($table, "url = " . sqlesc($menu));
if (empty($menus)) {
return;
}
foreach ($tables as $table) {
NexusDB::table($table)->whereIn('url', $menus)->delete();
}
}