order('id asc')->select(); $this->success('success',$list); } //新增举报 public function addone(){ $type = input('type',''); $to_user_id = input('to_user_id',0); $content = input('content',''); $images = input('images',''); if(empty($content)){ $this->error('内容不能为空'); } if(!empty($images) && strpos($images,',')){ if(count(explode(',',$images)) > 8){ $this->error('一次最多只能上传9张图片'); } } $data = [ 'user_id' => $this->auth->id, 'to_user_id' => $to_user_id, 'type' => $type, 'content' => $content, 'images' => $images, 'createtime' => time(), 'updatetime' => time(), ]; $id = Db::name('report')->insertGetId($data); $this->success(); } //IM举报 public function addone_im(){ $type = input('type',1);//类型:1=文字,2=语音,3=图片,4=阅后即焚 $to_user_id = input('to_user_id',0); $content = input('content',''); $image = input('images',''); $audio_file = input('audio_file',''); $data = [ 'type' => $type, 'user_id' => $this->auth->id, 'to_user_id' => $to_user_id, 'content' => $content, 'image' => $image, 'audio_file' => $audio_file, 'createtime' => time(), 'updatetime' => time(), ]; $id = Db::name('report_im')->insertGetId($data); $this->success('举报成功'); } }