mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
[H&R] basically
This commit is contained in:
@@ -3,12 +3,15 @@
|
||||
namespace Nexus\Install;
|
||||
|
||||
use App\Models\Attendance;
|
||||
use App\Models\BonusLogs;
|
||||
use App\Models\Category;
|
||||
use App\Models\Exam;
|
||||
use App\Models\ExamUser;
|
||||
use App\Models\Icon;
|
||||
use App\Models\Setting;
|
||||
use App\Models\User;
|
||||
use App\Repositories\ExamRepository;
|
||||
use Carbon\Carbon;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Support\Str;
|
||||
use Nexus\Database\NexusDB;
|
||||
@@ -56,6 +59,20 @@ class Update extends Install
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function addSetting($name, $value)
|
||||
{
|
||||
$attributes = [
|
||||
'name' => $name,
|
||||
];
|
||||
$now = Carbon::now()->toDateTimeString();
|
||||
$values = [
|
||||
'value' => $value,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
];
|
||||
return Setting::query()->firstOrCreate($attributes, $values);
|
||||
}
|
||||
|
||||
public function runExtraQueries()
|
||||
{
|
||||
//custom field menu
|
||||
@@ -111,6 +128,11 @@ class Update extends Install
|
||||
if (WITH_LARAVEL && VERSION_NUMBER == '1.6.0-beta9' && NexusDB::schema()->hasColumn('attendance', 'total_days')) {
|
||||
$this->migrateAttendance();
|
||||
}
|
||||
|
||||
if (WITH_LARAVEL && version_compare(VERSION_NUMBER, '1.6.0-beta12', '>=')) {
|
||||
$this->addSetting('authority.torrent_hr', User::CLASS_ADMINISTRATOR);
|
||||
$this->addSetting('bonus.cancel_hr', BonusLogs::DEFAULT_BONUS_CANCEL_ONE_HIT_AND_RUN);
|
||||
}
|
||||
}
|
||||
|
||||
private function migrateAttendance()
|
||||
|
||||
Reference in New Issue
Block a user