mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-05-01 09:37:23 +08:00
announce log menu only show when enabled
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Filament\Resources\Torrent;
|
|||||||
use App\Filament\Resources\Torrent\AnnounceLogResource\Pages;
|
use App\Filament\Resources\Torrent\AnnounceLogResource\Pages;
|
||||||
use App\Filament\Resources\Torrent\AnnounceLogResource\RelationManagers;
|
use App\Filament\Resources\Torrent\AnnounceLogResource\RelationManagers;
|
||||||
use App\Models\AnnounceLog;
|
use App\Models\AnnounceLog;
|
||||||
|
use App\Models\Setting;
|
||||||
use App\Models\Torrent;
|
use App\Models\Torrent;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
@@ -39,6 +40,14 @@ class AnnounceLogResource extends Resource
|
|||||||
return self::getNavigationLabel();
|
return self::getNavigationLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function shouldRegisterNavigation(): bool
|
||||||
|
{
|
||||||
|
return Setting::getIsRecordAnnounceLog() && config('clickhouse.connection.host') != '';
|
||||||
|
}
|
||||||
|
|
||||||
public static function infolist(Infolist $infolist): Infolist
|
public static function infolist(Infolist $infolist): Infolist
|
||||||
{
|
{
|
||||||
return $infolist
|
return $infolist
|
||||||
|
|||||||
@@ -234,9 +234,13 @@ class CalculateUserSeedBonus implements ShouldQueue
|
|||||||
do_log("clickhouse no host");
|
do_log("clickhouse no host");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$client = app(\ClickHouseDB\Client::class);
|
try {
|
||||||
$fields = ['business_type', 'uid', 'old_total_value', 'value', 'new_total_value', 'comment', 'created_at'];
|
$client = app(\ClickHouseDB\Client::class);
|
||||||
$client->insert("bonus_logs", $bonusLogInsert, $fields);
|
$fields = ['business_type', 'uid', 'old_total_value', 'value', 'new_total_value', 'comment', 'created_at'];
|
||||||
do_log("insertIntoClickHouseBulk done, created_at: {$bonusLogInsert[0]['created_at']}");
|
$client->insert("bonus_logs", $bonusLogInsert, $fields);
|
||||||
|
do_log("insertIntoClickHouseBulk done, created_at: {$bonusLogInsert[0]['created_at']}");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
do_log($e->getMessage(), 'error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user