0])->field('id,title,pid')->order('sort desc')->select()->toArray(); $list = make_tree($list); $this->success('ok',['list'=>$list]); } /** * @title 用户举报 * @desc 用户举报 * @author qc * @url /api/Report/userReport * @method POST * @header name:Authorization require:1 desc:Token * @param name:type type:int default:1 desc:举报类型(1视频2视频评论3会员,4资料,5图文6论坛问题) * @param name:report_id type:int default:-- desc:举报内容的id * @param name:case_ids type:string default:-- desc:举报类目id串(逗号隔开) */ public function userReport() { $type= input('post.type',1); $report_id= input('post.report_id'); $case_ids= input('post.case_ids'); if(!$report_id) $this->error('请现在举报内容'); if(!$case_ids) $this->error('请选择举报原因'); switch ($type) { case 1: $check_id = VideoIntro::where('id',$report_id)->value('id'); if(!$check_id) $this->error('视频不存在'); break; case 2: $check_id = VideoComment::where('id',$report_id)->value('id'); if(!$check_id) $this->error('视频评论不存在'); break; case 3: $check_id = User::where('id',$report_id)->value('id'); if(!$check_id) $this->error('会员不存在'); break; case 4: $check_id = DatumIntro::where('id',$report_id)->value('id'); if(!$check_id) $this->error('资料不存在'); break; case 5: $check_id = ArticleIntro::where('id',$report_id)->value('id'); if(!$check_id) $this->error('图文不存在'); break; case 6: $check_id = UserForum::where('id',$report_id)->value('id'); if(!$check_id) $this->error('论坛问题不存在'); break; } UserReport::report($this->user_id,$type,$report_id,$case_ids); $this->success('举报成功'); } }