0

我有 3 个用户我的 opencart 管理员,如下:

  • user_id=1
  • user_id=2
  • user_id=3

我的问题是,如果用户在不需要显示其他用户登录时间user_id=1时将某些类别添加到管理类别列表(例如:计算机、手机、标签等) ...我的意思是每个用户添加到类别列表中的内容,那user_id=2仅在他们登录用户帐户时显示...不允许显示其他用户...

sql

public function getCategories($parent_id = 0) {
    $category_data = $this->cache->get('category.' . (int)$this->config->get('config_language_id') . '.' . (int)$parent_id);

    if (!$category_data) {
        $category_data = array();

        $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY c.sort_order, cd.name ASC");

        foreach ($query->rows as $result) {
            $category_data[] = array(
                'category_id' => $result['category_id'],
                'name'        => $this->getPath($result['category_id'], $this->config->get('config_language_id')),
                'status'      => $result['status'],
                'sort_order'  => $result['sort_order']
            );

            $category_data = array_merge($category_data, $this->getCategories($result['category_id']));
        }   

        $this->cache->set('category.' . (int)$this->config->get('config_language_id') . '.' . (int)$parent_id, $category_data);
    }

    return $category_data;
}

任何想法。??谢谢...

4

0 回答 0