fix get_globao_sp_state

This commit is contained in:
xiaomlove
2022-07-30 15:42:07 +08:00
parent b6b7a965d1
commit bb585ec631
+4 -2
View File
@@ -10,11 +10,13 @@ function get_global_sp_state()
\Nexus\Database\NexusDB::cache_put($cacheKey . '_deadline', $row['deadline'], 600); \Nexus\Database\NexusDB::cache_put($cacheKey . '_deadline', $row['deadline'], 600);
return $row; return $row;
}); });
if (isset($row['deadline']) && $row['deadline'] < date('Y-m-d H:i:s')) { if (is_array($row) && isset($row['deadline']) && $row['deadline'] < date('Y-m-d H:i:s')) {
//expired //expired
$global_promotion_state = \App\Models\Torrent::PROMOTION_NORMAL; $global_promotion_state = \App\Models\Torrent::PROMOTION_NORMAL;
} else { } elseif (is_array($row)) {
$global_promotion_state = $row["global_sp_state"]; $global_promotion_state = $row["global_sp_state"];
} else {
$global_promotion_state = $row;
} }
} }
return $global_promotion_state; return $global_promotion_state;