mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
add back to top
This commit is contained in:
@@ -211,6 +211,17 @@ class Update extends Install
|
||||
$this->doLog("[ADD_ATTENDANCE_CARD_TO_USERS], migrateAttendanceLogs: $count");
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.0
|
||||
*
|
||||
* add amountattendancecard.php
|
||||
*/
|
||||
$menus = [
|
||||
['name' => 'Add Attendance card', 'url' => 'amountattendancecard.php', 'info' => 'Add Attendance card to certain classes'],
|
||||
];
|
||||
$table = 'sysoppanel';
|
||||
$this->addMenu($table, $menus);
|
||||
|
||||
}
|
||||
|
||||
public function runExtraMigrate()
|
||||
@@ -235,6 +246,17 @@ class Update extends Install
|
||||
|
||||
}
|
||||
|
||||
private function addMenu($table, array $menus)
|
||||
{
|
||||
foreach ($menus as $menu) {
|
||||
$count = get_row_count($table, "where url = " . sqlesc($menu['url']));
|
||||
if ($count == 0) {
|
||||
$id = NexusDB::insert($table, $menu);
|
||||
$this->doLog("[ADD MENU] insert: " . json_encode($menu) . " to table: $table, id: $id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function listVersions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user