mirror of https://gitee.com/karson/fastadmin.git
修复调用PID为0时无法调用顶级分类
parent
32f256f3fa
commit
908039c13d
|
|
@ -220,17 +220,16 @@ class Ajax extends Backend
|
||||||
$type = $this->request->get('type');
|
$type = $this->request->get('type');
|
||||||
$pid = $this->request->get('pid');
|
$pid = $this->request->get('pid');
|
||||||
$where = ['status' => 'normal'];
|
$where = ['status' => 'normal'];
|
||||||
$categorylist = null;
|
$categorylist = null;
|
||||||
if ($pid !== '') {
|
if ($pid || $pid === '0') {
|
||||||
if ($type) {
|
$where['pid'] = $pid;
|
||||||
$where['type'] = $type;
|
|
||||||
}
|
|
||||||
if ($pid) {
|
|
||||||
$where['pid'] = $pid;
|
|
||||||
}
|
|
||||||
|
|
||||||
$categorylist = Db::name('category')->where($where)->field('id as value,name')->order('weigh desc,id desc')->select();
|
|
||||||
}
|
}
|
||||||
|
if ($type) {
|
||||||
|
$where['type'] = $type;
|
||||||
|
}
|
||||||
|
|
||||||
|
$categorylist = Db::name('category')->where($where)->field('id as value,name')->order('weigh desc,id desc')->select();
|
||||||
|
|
||||||
$this->success('', null, $categorylist);
|
$this->success('', null, $categorylist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue