我的opencart管理员有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;
}
任何想法。??感谢...