mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
add seed bonus + seed time update time
This commit is contained in:
@@ -94,7 +94,8 @@ class CalculateUserSeedBonus implements ShouldQueue
|
||||
$dividend = 3600 / $autoclean_interval_one;
|
||||
$all_bonus = $all_bonus / $dividend;
|
||||
$seed_points = $seedBonusResult['seed_points'] / $dividend;
|
||||
$sql = "update users set seed_points = ifnull(seed_points, 0) + $seed_points, seedbonus = seedbonus + $all_bonus where id = $uid limit 1";
|
||||
$updatedAt = now()->toDateTimeString();
|
||||
$sql = "update users set seed_points = ifnull(seed_points, 0) + $seed_points, seedbonus = seedbonus + $all_bonus, seed_points_updated_at = '$updatedAt' where id = $uid limit 1";
|
||||
do_log("$bonusLog, query: $sql");
|
||||
NexusDB::statement($sql);
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ class UpdateUserSeedingLeechingTime implements ShouldQueue
|
||||
$beginTimestamp = time();
|
||||
$logPrefix = sprintf("[CLEANUP_CLI_UPDATE_SEEDING_LEECHING_TIME], commonRequestId: %s, beginUid: %s, endUid: %s", $this->requestId, $this->beginUid, $this->endUid);
|
||||
$sql = sprintf(
|
||||
"update users set seedtime = (select sum(seedtime) from snatched where userid = users.id), leechtime=(select sum(leechtime) from snatched where userid = users.id) where id > %s and id <= %s and status = 'confirmed' and enabled = 'yes'",
|
||||
$this->beginUid, $this->endUid
|
||||
"update users set seedtime = (select sum(seedtime) from snatched where userid = users.id), leechtime=(select sum(leechtime) from snatched where userid = users.id), seed_time_updated_at = '%s' where id > %s and id <= %s and status = 'confirmed' and enabled = 'yes'",
|
||||
$this->beginUid, $this->endUid, now()->toDateTimeString()
|
||||
);
|
||||
$results = NexusDB::statement($sql);
|
||||
$costTime = time() - $beginTimestamp;
|
||||
|
||||
@@ -25,17 +25,17 @@
|
||||
"ext-bcmath": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-gd": "*",
|
||||
"ext-gmp": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-mysqli": "*",
|
||||
"ext-pcntl": "*",
|
||||
"ext-redis": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-gmp": "*",
|
||||
"ext-zend-opcache": "*",
|
||||
"doctrine/dbal": "^3.1",
|
||||
"elasticsearch/elasticsearch": "^7.16",
|
||||
"filament/filament": "2.16.41",
|
||||
"filament/filament": "2.16.51",
|
||||
"flowframe/laravel-trend": "^0.1.1",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"geoip2/geoip2": "~2.0",
|
||||
|
||||
2124
composer.lock
generated
2124
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dateTime('seed_points_updated_at')->nullable(true);
|
||||
$table->dateTime('seed_time_updated_at')->nullable(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('seed_points_updated_at', 'seed_time_updated_at');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-11-14');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-11-23');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -322,6 +322,7 @@ class Update extends Install
|
||||
if (empty($menus)) {
|
||||
return;
|
||||
}
|
||||
$this->doLog("[REMOVE MENU]: " . json_encode($menus));
|
||||
foreach ($tables as $table) {
|
||||
NexusDB::table($table)->whereIn('url', $menus)->delete();
|
||||
}
|
||||
|
||||
@@ -303,9 +303,11 @@ final class Nexus
|
||||
|
||||
private static function loadTranslations($path, $namespace = null)
|
||||
{
|
||||
do_log("path: $path, namespace: $namespace", 'debug');
|
||||
$files = glob($path . '*/*');
|
||||
foreach ($files as $file) {
|
||||
if (!is_file($file)) {
|
||||
do_log("file: $file, is not file", 'debug');
|
||||
continue;
|
||||
}
|
||||
if (!is_readable($file)) {
|
||||
@@ -320,7 +322,7 @@ final class Nexus
|
||||
if ($namespace !== null) {
|
||||
$setKey = "$namespace.$setKey";
|
||||
}
|
||||
// do_log("path: $path, namespace: $namespace, file: $file, setKey: $setKey", 'debug');
|
||||
do_log("path: $path, namespace: $namespace, file: $file, setKey: $setKey", 'debug');
|
||||
arr_set(self::$translations, $setKey, $values);
|
||||
}
|
||||
}
|
||||
|
||||
3
public/styles/nexus.css
vendored
3
public/styles/nexus.css
vendored
@@ -64,3 +64,6 @@ img.hitandrun {
|
||||
.nexus-media-info-raw pre {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
.text-muted {
|
||||
color: #7d7b7b
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ if ($user["downloaded"] > 0 && $true_download > 0)
|
||||
//end
|
||||
|
||||
$xfer = "<tr><td class=\"embedded\"><strong>" . $lang_userdetails['row_uploaded'] . "</strong>: ". mksize($user["uploaded"]) . "</td><td class=\"embedded\"> <strong>" . $lang_userdetails['row_downloaded'] . "</strong>: " . mksize($user["downloaded"]) . "</td></tr>";
|
||||
$true_xfer = "<tr><td class=\"embedded\"><strong>" . $lang_userdetails['row_real_uploaded'] . "</strong>: ". mksize($true_upload) . "</td><td class=\"embedded\"> <strong>" . $lang_userdetails['row_real_downloaded'] . "</strong>: " . mksize($true_download) . "</td><td class=\"embedded\" style=\"color: #7d7b7b;\"> " . $lang_userdetails['row_real_ps'] . "</td></tr>";
|
||||
$true_xfer = "<tr><td class=\"embedded\"><strong>" . $lang_userdetails['row_real_uploaded'] . "</strong>: ". mksize($true_upload) . "</td><td class=\"embedded\"> <strong>" . $lang_userdetails['row_real_downloaded'] . "</strong>: " . mksize($true_download) . "</td><td class=\"embedded text-muted\"> " . $lang_userdetails['row_real_ps'] . "</td></tr>";
|
||||
tr_small($lang_userdetails['row_transfer'], "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" . ($sr ?? '') . $xfer . $true_xfer . "</table>", 1);
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ if ($user["leechtime"] > 0)
|
||||
$slr = "<tr><td class=\"embedded\"><strong>" . $lang_userdetails['text_seeding_leeching_time_ratio'] . "</strong>: <font color=\"" . get_ratio_color($slr) . "\">" . number_format($slr, 3) . "</font></td><td class=\"embedded\"> " . get_ratio_img($slr) . "</td></tr>";
|
||||
}
|
||||
|
||||
$slt = "<tr><td class=\"embedded\"><strong>" . $lang_userdetails['text_seeding_time'] . "</strong>: ". mkprettytime($user["seedtime"]) . "</td><td class=\"embedded\"> <strong>" . $lang_userdetails['text_leeching_time'] . "</strong>: " . mkprettytime($user["leechtime"]) . "</td></tr>";
|
||||
$slt = "<tr><td class=\"embedded\"><strong>" . $lang_userdetails['text_seeding_time'] . "</strong>: ". mkprettytime($user["seedtime"]) . "</td><td class=\"embedded\"> <strong>" . $lang_userdetails['text_leeching_time'] . "</strong>: " . mkprettytime($user["leechtime"]) . "</td><td class=\"embedded text-muted\"> (" . nexus_trans('label.updated_at') . ": " . $user['seed_time_updated_at'] . ")</td></tr>";
|
||||
|
||||
tr_small($lang_userdetails['row_sltime'], "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" . ($slr ?? '') . $slt . "</table>", 1);
|
||||
|
||||
@@ -400,7 +400,7 @@ if ($user["id"] == $CURUSER["id"] || user_can('viewhistory')) {
|
||||
tr_small($lang_functions['menu_claim'], sprintf('<a href="claim.php?uid=%s" target="_blank">%s</a>', $user['id'], $states), 1);
|
||||
}
|
||||
tr_small($lang_userdetails['row_karma_points'], number_format($user['seedbonus'], 1), 1);
|
||||
tr_small($lang_functions['text_seed_points'], number_format($user['seed_points'], 1), 1);
|
||||
tr_small($lang_functions['text_seed_points'], number_format($user['seed_points'], 1) . " <span class='text-muted'>(" . nexus_trans('label.updated_at') . ": " . $user['seed_points_updated_at'] . ")</span>", 1);
|
||||
}
|
||||
|
||||
if (user_can('prfmanage') && $user["class"] < get_user_class()) {
|
||||
|
||||
Reference in New Issue
Block a user