model = new Fankui; } public function gettype(){ //获取反馈类型 $info = FKType::where('status',1)->select(); Tree::instance()->init($info); $info = Tree::instance()->getTreeArray(0); return $this->success('获取成功',$info); } public function getlist(){ $data = $this->request->post(); if($this->request->isPost()){ $uid = $this->auth->id; $offset = $data['offset']; $limit = $data['limit']; $where['user_id'] = $uid; $order = ['createtime'=>'desc']; $list = $this->model->getlist($where, $order, $offset, $limit); return $this->success('获取成功',$list); } } public function setfankui(){ $data = $this->request->post(); if($this->request->isPost()){ $uid = $this->auth->id; $insert['user_id'] = $uid; $insert['type'] = $data['type']; $insert['type_item'] = $data['type_item']; $insert['content'] = $data['content']; $insert['image'] = $data['image']; $insert['phone'] = $data['phone']; $insert['email'] = $data['email']; $insert['createtime'] = date("Y-m-d H:i:s"); $this->model->insert($insert); return $this->success('提交成功'); } return $this->error("非法请求"); } }