|
@@ -25,7 +25,7 @@ class Consult extends BaseController
|
|
|
public function list(){
|
|
|
$page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) :"1";
|
|
|
$size = isset($this->post['size']) && $this->post['size'] !== "" ? intval($this->post['size']) :"10";
|
|
|
- $where=[['is_del',"=",0]];
|
|
|
+ $where=[['is_del',"=",0],["cat_id","<>",0]];
|
|
|
$zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
|
|
|
if ($zxNo !== "") {
|
|
|
$where[] = ['zxNo','=',$zxNo];
|
|
@@ -67,8 +67,13 @@ class Consult extends BaseController
|
|
|
$page = $page >= $total ? $total : $page;
|
|
|
$list = Db::name('consult')->where($where)->page($page,$size)
|
|
|
->field('id,zxNo,salesman,khNo,zxtime,zxtype,color,cpname,model,material,num,unit,total_fee,desc,
|
|
|
- sale_price,sale_fee,khname,scheme_name,status,sequenceNo')->select();
|
|
|
- return app_show(0,"获取成功",['count'=>$count,'list'=>$list]);
|
|
|
+ sale_price,sale_fee,khname,scheme_name,status,sequenceNo,cat_id')->select();
|
|
|
+ $data=[];
|
|
|
+ foreach ($list as $value){
|
|
|
+ $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
|
|
|
+ $data[]=$value;
|
|
|
+ }
|
|
|
+ return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
|
|
|
}
|
|
|
public function info(){
|
|
|
$id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) : "";
|
|
@@ -76,6 +81,8 @@ class Consult extends BaseController
|
|
|
return error_show(1002,"咨询单编号不能为空");
|
|
|
}
|
|
|
$fo = Db::name('consult')->where(['id'=>$id,'is_del'=>0])->find();
|
|
|
+ $in= isset($fo['cat_id']) && $fo['cat_id'] !=0 ? made($fo['cat_id']):[];
|
|
|
+ $fo['can']=$in;
|
|
|
if(empty($fo)){
|
|
|
return error_show(1002,"未找到咨询单编号");
|
|
|
}else{
|