input('pid'); $classify_name=$request->input('classify_name'); $level=$request->input('level'); $res=ClassifyRepair::where('classify_name',$classify_name)->first(); if($res){ return $this->fail(['40013','当前分类已存在']); } $re=new ClassifyRepair(); $re->level=$level; $re->classify_name=$classify_name; $re->pid=$pid; $re->status=0; $re->save(); return $this->success(['id'=>$re->id]); } }