我尝试在管理页面中的某些CRUD操作期间使用seo_pro
删除$this->cache->delete('seo_pro')
缓存文件。但它不起作用。
示例:
public function addCategory($data) {
$this->event->trigger('pre.admin.category.add', $data);
$this->db->query("INSERT INTO " . DB_PREFIX . "category SET parent_id = '" . (int)$data['parent_id'] . "', `top` = '" . (isset($data['top']) ? (int)$data['top'] : 0) . "', `column` = '" . (int)$data['column'] . "', sort_order = '" . (int)$data['sort_order'] . "', status = '" . (int)$data['status'] . "', date_modified = NOW(), date_added = NOW()");
$category_id = $this->db->getLastId();
if (isset($data['image'])) {
$this->db->query("UPDATE " . DB_PREFIX . "category SET image = '" . $this->db->escape($data['image']) . "' WHERE category_id = '" . (int)$category_id . "'");
}
foreach ($data['category_description'] as $language_id => $value) {
$this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "'");
}
// MySQL Hierarchical Data Closure Table Pattern
$level = 0;
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "category_path` WHERE category_id = '" . (int)$data['parent_id'] . "' ORDER BY `level` ASC");
foreach ($query->rows as $result) {
$this->db->query("INSERT INTO `" . DB_PREFIX . "category_path` SET `category_id` = '" . (int)$category_id . "', `path_id` = '" . (int)$result['path_id'] . "', `level` = '" . (int)$level . "'");
$level++;
}
$this->db->query("INSERT INTO `" . DB_PREFIX . "category_path` SET `category_id` = '" . (int)$category_id . "', `path_id` = '" . (int)$category_id . "', `level` = '" . (int)$level . "'");
if (isset($data['category_filter'])) {
foreach ($data['category_filter'] as $filter_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "category_filter SET category_id = '" . (int)$category_id . "', filter_id = '" . (int)$filter_id . "'");
}
}
if (isset($data['category_store'])) {
foreach ($data['category_store'] as $store_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "category_to_store SET category_id = '" . (int)$category_id . "', store_id = '" . (int)$store_id . "'");
}
}
// Set which layout to use with this category
if (isset($data['category_layout'])) {
foreach ($data['category_layout'] as $store_id => $layout_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "category_to_layout SET category_id = '" . (int)$category_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout_id . "'");
}
}
if (isset($data['keyword'])) {
$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'category_id=" . (int)$category_id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
}
$this->cache->delete('seo_pro');
$this->cache->delete('category');
$this->event->trigger('post.admin.category.add', $category_id);
return $category_id;
}
一件有趣的事情 - $this->cache->delete('category')
完美无缺。
答案 0 :(得分:0)
抱歉我的沉默。我通过删除 system / storage / modification 文件夹中的相同文件解决了这个问题。