mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
fix pos_state no until
This commit is contained in:
@@ -146,13 +146,14 @@ if(user_can('torrentonpromotion'))
|
||||
if(user_can('torrentsticky'))
|
||||
{
|
||||
if (isset($_POST['pos_state']) && isset(\App\Models\Torrent::$posStates[$_POST['pos_state']])) {
|
||||
$posStateUntil = null;
|
||||
$posState = \App\Models\Torrent::POS_STATE_STICKY_NONE;
|
||||
if (!empty($_POST['pos_state_until']) && $_POST['pos_state'] != \App\Models\Torrent::POS_STATE_STICKY_NONE) {
|
||||
$posStateUntil = \Carbon\Carbon::parse($_POST['pos_state_until']);
|
||||
if ($posStateUntil->gte(now())) {
|
||||
$posState = $_POST['pos_state'];
|
||||
}
|
||||
$posStateUntil = $_POST['pos_state_until'] ?: null;
|
||||
$posState = $_POST['pos_state'];
|
||||
if ($posState == \App\Models\Torrent::POS_STATE_STICKY_NONE) {
|
||||
$posStateUntil = null;
|
||||
}
|
||||
if ($posStateUntil && \Carbon\Carbon::parse($posStateUntil)->lte(now())) {
|
||||
$posState = \App\Models\Torrent::POS_STATE_STICKY_NONE;
|
||||
$posStateUntil = null;
|
||||
}
|
||||
$updateset[] = sprintf("pos_state = %s", sqlesc($posState));
|
||||
$updateset[] = sprintf("pos_state_until = %s", sqlesc($posStateUntil));
|
||||
|
||||
@@ -344,13 +344,14 @@ if (isset($_POST['hr']) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr']]) &
|
||||
}
|
||||
if(user_can('torrentsticky')) {
|
||||
if (isset($_POST['pos_state']) && isset(\App\Models\Torrent::$posStates[$_POST['pos_state']])) {
|
||||
$posStateUntil = null;
|
||||
$posState = \App\Models\Torrent::POS_STATE_STICKY_NONE;
|
||||
if (!empty($_POST['pos_state_until']) && $_POST['pos_state'] != \App\Models\Torrent::POS_STATE_STICKY_NONE) {
|
||||
$posStateUntil = \Carbon\Carbon::parse($_POST['pos_state_until']);
|
||||
if ($posStateUntil->gte(now())) {
|
||||
$posState = $_POST['pos_state'];
|
||||
}
|
||||
$posStateUntil = $_POST['pos_state_until'] ?: null;
|
||||
$posState = $_POST['pos_state'];
|
||||
if ($posState == \App\Models\Torrent::POS_STATE_STICKY_NONE) {
|
||||
$posStateUntil = null;
|
||||
}
|
||||
if ($posStateUntil && \Carbon\Carbon::parse($posStateUntil)->lte(now())) {
|
||||
$posState = \App\Models\Torrent::POS_STATE_STICKY_NONE;
|
||||
$posStateUntil = null;
|
||||
}
|
||||
$insert['pos_state'] = $posState;
|
||||
$insert['pos_state_until'] = $posStateUntil;
|
||||
|
||||
Reference in New Issue
Block a user