| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 | 
							- <?php
 
- namespace app\api\controller;
 
- use app\common\controller\Api;
 
- use app\common\library\Keyworld;
 
- use think\Db;
 
- /**
 
-  * 智能助手 提交反馈
 
-  */
 
- class Feedback extends Api
 
- {
 
-     protected $noNeedLogin = ['category'];
 
-     protected $noNeedRight = ['*'];
 
-     //分类
 
-     public function category(){
 
-         $list = Db::name('feedback_category')->field('id, name')->where('status',1)->order('weigh', 'desc')->select();
 
-         $this->success(1,$list);
 
-     }
 
-     public function submit(){
 
-         $category = input('category','','trim');
 
-         $info = input('info','','trim');
 
-         $images = input('images','','trim');
 
-         $is_hidden = input('is_hidden',0);
 
-         if(empty($info)){
 
-             $this->error('请输入问题描述');
 
-         }
 
-         $images_arr = explode(',',$images);
 
-         if(count($images_arr) > 9){
 
-             $this->error('最多只能传9张图片');
 
-         }
 
-         //关键字替换
 
-         $info = Keyworld::sensitive($info);
 
-         $data = [
 
-             'user_id' => $this->auth->id,
 
-             'category' => $category,
 
-             'info' => $info,
 
-             'images' => $images,
 
-             'is_hidden' => $is_hidden,
 
-             'createtime' => time(),
 
-             'updatetime' => time(),
 
-         ];
 
-         $id = Db::name('feedback')->insertGetId($data);
 
-         $this->success('提交成功', $id);
 
-     }
 
-     public function lists(){
 
-         $status = input('status',0);
 
-         $where = [
 
-             'user_id' => $this->auth->id,
 
-             'status' => $status,
 
-         ];
 
-         $list = Db::name('feedback')->where($where)->order('id desc')->autopage()->select();
 
-         $list = list_domain_image($list,['images']);
 
-         $this->success(1, $list);
 
-     }
 
- }
 
 
  |