|
@@ -32,7 +32,10 @@ class Category extends Backend
|
|
|
$this->model = model('app\common\model\Category');
|
|
|
|
|
|
$tree = Tree::instance();
|
|
|
- $tree->init(collection($this->model->where('cid', 'in', [0, $this->auth->getUserInfo()['cid']])->order('weigh desc,id desc')->select())->toArray(), 'pid');
|
|
|
+ if ($this->auth->getUserInfo()['cid'] == 0)
|
|
|
+ $tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'pid');
|
|
|
+ else
|
|
|
+ $tree->init(collection($this->model->where('cid', 'in', [0, $this->auth->getUserInfo()['cid']])->order('weigh desc,id desc')->select())->toArray(), 'pid');
|
|
|
$this->categorylist = $tree->getTreeList($tree->getTreeArray(0), 'name');
|
|
|
$categorydata = [0 => ['type' => 'all', 'name' => __('None')]];
|
|
|
foreach ($this->categorylist as $k => $v) {
|