接口修改4
This commit is contained in:
parent
62a174c0d9
commit
b3cdc4f743
@ -322,7 +322,12 @@ class Common extends BaseController
|
|||||||
if ($id==0 && $type==''){
|
if ($id==0 && $type==''){
|
||||||
return $this->apiError('参数不能为空,请填写参数');
|
return $this->apiError('参数不能为空,请填写参数');
|
||||||
}
|
}
|
||||||
|
if($pid){
|
||||||
$where[]=['pid','=',$pid];
|
$where[]=['pid','=',$pid];
|
||||||
|
}else{
|
||||||
|
$where[]=['pid','<>',0];
|
||||||
|
}
|
||||||
|
|
||||||
$where[]=['status','=','normal'];
|
$where[]=['status','=','normal'];
|
||||||
$select=Db::table('fa_category')->where($where)->select();
|
$select=Db::table('fa_category')->where($where)->select();
|
||||||
return $this->apiSuccess('ok',$select);
|
return $this->apiSuccess('ok',$select);
|
||||||
@ -359,7 +364,11 @@ class Common extends BaseController
|
|||||||
if ($id==0 && $type==''){
|
if ($id==0 && $type==''){
|
||||||
return $this->apiError('参数不能为空,请填写参数');
|
return $this->apiError('参数不能为空,请填写参数');
|
||||||
}
|
}
|
||||||
|
if($pid){
|
||||||
$where[]=['pid','=',$pid];
|
$where[]=['pid','=',$pid];
|
||||||
|
}else{
|
||||||
|
$where[]=['pid','<>',0];
|
||||||
|
}
|
||||||
$where[]=['status','=','normal'];
|
$where[]=['status','=','normal'];
|
||||||
$select=Db::table('fa_category')->where($where)->field('id as category_id,name as topic_name,image as pic,pid')->select()->toArray();
|
$select=Db::table('fa_category')->where($where)->field('id as category_id,name as topic_name,image as pic,pid')->select()->toArray();
|
||||||
foreach ($select as $k=>$v){
|
foreach ($select as $k=>$v){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user