mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 15:12:21 +08:00
judge H&R count think about section
This commit is contained in:
@@ -44,8 +44,8 @@ class HitAndRunUpdateStatus extends Command
|
|||||||
$rep = new HitAndRunRepository();
|
$rep = new HitAndRunRepository();
|
||||||
$result = $rep->cronjobUpdateStatus($uid, $torrentId, $ignoreTime);
|
$result = $rep->cronjobUpdateStatus($uid, $torrentId, $ignoreTime);
|
||||||
$log = sprintf(
|
$log = sprintf(
|
||||||
'[%s], %s, uid: %s, torrentId: %s, result: %s',
|
'[%s], %s, uid: %s, torrentId: %s, ignoreTime: %s, result: %s',
|
||||||
nexus()->getRequestId(), __METHOD__, $uid, $torrentId, var_export($result, true)
|
nexus()->getRequestId(), __METHOD__, $uid, $torrentId, $ignoreTime, var_export($result, true)
|
||||||
);
|
);
|
||||||
$this->info($log);
|
$this->info($log);
|
||||||
do_log($log);
|
do_log($log);
|
||||||
|
|||||||
@@ -89,8 +89,10 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$r = strstr('hr.*', '.', true);
|
$rep = new \NexusPlugin\HitAndRun\HitAndRunRepository();
|
||||||
dd($r);
|
$rep->initSectionHitAndRunSetting(SearchBox::SECTION_BROWSE . "_");
|
||||||
|
$rep->initSectionHitAndRunSetting(SearchBox::SECTION_SPECIAL . "_");
|
||||||
|
clear_setting_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class HitAndRunResource extends Resource
|
|||||||
|
|
||||||
public static function getEloquentQuery(): Builder
|
public static function getEloquentQuery(): Builder
|
||||||
{
|
{
|
||||||
return parent::getEloquentQuery()->with(['user', 'torrent', 'snatch']);
|
return parent::getEloquentQuery()->with(['user', 'torrent', 'snatch', 'torrent.basic_category']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getRelations(): array
|
public static function getRelations(): array
|
||||||
|
|||||||
@@ -335,7 +335,12 @@ class HitAndRunRepository extends BaseRepository
|
|||||||
//disable user
|
//disable user
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = $hitAndRun->user;
|
$user = $hitAndRun->user;
|
||||||
$counts = $user->hitAndRuns()->where('status', HitAndRun::STATUS_UNREACHED)->count();
|
$counts = $user->hitAndRuns()
|
||||||
|
->where('status', HitAndRun::STATUS_UNREACHED)
|
||||||
|
->whereHas('torrent.basic_category', function (Builder $query) use ($searchBoxId) {
|
||||||
|
return $query->where('mode', $searchBoxId);
|
||||||
|
})
|
||||||
|
->count();
|
||||||
$disableCounts = HitAndRun::getConfig('ban_user_when_counts_reach', $searchBoxId);
|
$disableCounts = HitAndRun::getConfig('ban_user_when_counts_reach', $searchBoxId);
|
||||||
do_log("user: {$user->id}, H&R counts: $counts, disableCounts: $disableCounts", 'notice');
|
do_log("user: {$user->id}, H&R counts: $counts, disableCounts: $disableCounts", 'notice');
|
||||||
if ($counts >= $disableCounts) {
|
if ($counts >= $disableCounts) {
|
||||||
|
|||||||
@@ -971,7 +971,7 @@ function clear_user_cache($uid, $passkey = '')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear_setting_cache($buildPermissionCache = false)
|
function clear_setting_cache()
|
||||||
{
|
{
|
||||||
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_laravel');
|
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_laravel');
|
||||||
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_nexus');
|
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_nexus');
|
||||||
|
|||||||
Reference in New Issue
Block a user