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