taxonomy create/edit redirect

This commit is contained in:
xiaomlove
2022-11-09 21:56:03 +08:00
parent b92b911b1e
commit 6479f0a799
17 changed files with 105 additions and 20 deletions
+9 -2
View File
@@ -3265,12 +3265,17 @@ function genrelist($catmode = 1) {
return $ret;
}
function searchbox_item_list($table, $mode){
function searchbox_item_list(string $table, int $mode){
global $Cache;
$cacheKey = "{$table}_list_mode_{$mode}";
if (!$ret = $Cache->get_value($cacheKey)){
$ret = array();
$res = sql_query("SELECT * FROM $table where (mode = '$mode' or mode = 0) ORDER BY sort_index, id");
$sql = "SELECT * FROM $table";
if ($mode > 0) {
$sql .= " where (mode = '$mode' or mode = 0)";
}
$sql .= " ORDER BY sort_index, id";
$res = sql_query($sql);
while ($row = mysql_fetch_array($res))
$ret[] = $row;
$Cache->cache_value($cacheKey, $ret, 3600);
@@ -6066,6 +6071,8 @@ TD;
->where(function (\Illuminate\Database\Query\Builder $query) use ($mode) {
return $query->where('mode', $mode)->orWhere('mode', 0);
})
->orderBy('sort_index', 'asc')
->orderBy('id', 'asc')
->get()
->chunk($searchBox->catsperrow);
foreach ($taxonomyChunks as $chunk) {
+19 -1
View File
@@ -972,7 +972,7 @@ function getDataTraffic(array $torrent, array $queries, array $user, $peer, $sna
function clear_user_cache($uid, $passkey = '')
{
do_log("uid: $uid, passkey: $passkey");
do_log("clear_user_cache, uid: $uid, passkey: $passkey");
\Nexus\Database\NexusDB::cache_del("user_{$uid}_content");
\Nexus\Database\NexusDB::cache_del("user_{$uid}_roles");
\Nexus\Database\NexusDB::cache_del("announce_user_passkey_$uid");//announce.php
@@ -984,6 +984,7 @@ function clear_user_cache($uid, $passkey = '')
function clear_setting_cache()
{
do_log("clear_setting_cache");
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_laravel');
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_nexus');
}
@@ -993,15 +994,32 @@ function clear_setting_cache()
*/
function clear_category_cache()
{
do_log("clear_category_cache");
\Nexus\Database\NexusDB::cache_del('category_content');
}
/**
* @see functions.php::searchbox_item_list()
*/
function clear_taxonomy_cache($table)
{
do_log("clear_taxonomy_cache: $table");
$list = \App\Models\SearchBox::query()->get(['id']);
foreach ($list as $item) {
\Nexus\Database\NexusDB::cache_del("{$table}_list_mode_{$item->id}");
}
\Nexus\Database\NexusDB::cache_del("{$table}_list_mode_0");
}
function clear_staff_message_cache()
{
do_log("clear_staff_message_cache");
\App\Repositories\MessageRepository::updateStaffMessageCountCache(false);
}
/**
* @see functions.php::get_searchbox_value()
*/
function clear_search_box_cache()
{
do_log("clear_search_box_cache");