mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
revert User::getDonateStatusAttribute()
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Http\Middleware\Locale;
|
use App\Http\Middleware\Locale;
|
||||||
|
use App\Repositories\ExamRepository;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
@@ -94,6 +95,19 @@ class User extends Authenticatable
|
|||||||
return $classText;
|
return $classText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ExamRepository::isExamMatchUser()
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDonateStatusAttribute(): string
|
||||||
|
{
|
||||||
|
if ($this->isDonating()) {
|
||||||
|
return self::DONATE_YES;
|
||||||
|
}
|
||||||
|
return self::DONATE_NO;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为数组 / JSON 序列化准备日期。
|
* 为数组 / JSON 序列化准备日期。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.13');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.13');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-05-30');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-05-31');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', true);
|
defined('IN_TRACKER') || define('IN_TRACKER', true);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
+14
-14
@@ -543,22 +543,22 @@ if (count($updateset)) // Update only when there is change in peer counts
|
|||||||
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $torrentid");
|
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $torrentid");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($client_familyid != 0 && $client_familyid != $az['clientselect'])
|
if($client_familyid != 0 && $client_familyid != $az['clientselect']) {
|
||||||
$USERUPDATESET[] = "clientselect = ".sqlesc($client_familyid);
|
$USERUPDATESET[] = "clientselect = ".sqlesc($client_familyid);
|
||||||
|
}
|
||||||
if(count($USERUPDATESET) && $userid)
|
/**
|
||||||
{
|
* VIP do not calculate downloaded
|
||||||
/**
|
* @since 1.7.13
|
||||||
* VIP do not calculate downloaded
|
*/
|
||||||
* @since 1.7.13
|
if ($az['class'] == UC_VIP) {
|
||||||
*/
|
foreach ($USERUPDATESET as $key => $value) {
|
||||||
if ($az['class'] == UC_VIP) {
|
if (str_contains($value, 'downloaded')) {
|
||||||
foreach ($USERUPDATESET as $key => $value) {
|
unset($USERUPDATESET[$key]);
|
||||||
if (str_contains($value, 'downloaded')) {
|
|
||||||
unset($USERUPDATESET[$key]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(count($USERUPDATESET) && $userid)
|
||||||
|
{
|
||||||
sql_query("UPDATE users SET " . join(",", $USERUPDATESET) . " WHERE id = ".$userid);
|
sql_query("UPDATE users SET " . join(",", $USERUPDATESET) . " WHERE id = ".$userid);
|
||||||
}
|
}
|
||||||
benc_resp($rep_dict);
|
benc_resp($rep_dict);
|
||||||
|
|||||||
Reference in New Issue
Block a user