title = '举报列表'; $type=input('type',8); $where= []; if($this->request->request('name')) $where[]= ['m.name','like','%'.$this->request->request('name').'%']; if($this->request->request('content')) $where[]= ['f.content','like','%'.$this->request->request('content').'%']; $where[]= ['f.is_deleted','=',0]; $where[]= ['f.type','=',$type]; $query = $this->_query($this->table); $query->alias('f') ->field('f.* ,m.headimg,m.name') ->join('store_member m',' m.id = f.user_id ','LEFT'); if(!empty($where)) $query->where($where); $query ->order('f.id desc')->page(); } /**反馈列表处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ protected function _index_page_filter(array &$data) { array_walk($data,function (&$val,$key){ $val['report_arr'] = \app\common\model\ReportCase::where('id','in',$val['case_ids'])->column('title'); switch ($val['type']) { case 2: $val['object_info'] = \app\common\model\VideoComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\VideoUrl::field('a.id second_id,a.title second_title, b.id first_id,b.title first_title') ->alias('a') ->where('a.id', $val['object_info']['url_id']) ->leftJoin('VideoIntro b','b.id = a.video_id') ->find()->toArray(); break; case 8: $val['object_info'] = \app\common\model\ArticleComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\ArticleItem::field('a.id second_id,a.title second_title, b.id first_id,b.title first_title') ->alias('a') ->where('a.id', $val['object_info']['item_id']) ->leftJoin('ArticleIntro b','b.id = a.article_id') ->find()->toArray(); break; case 9: $val['object_info'] = \app\common\model\PressComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\Press::field('a.id second_id,a.title second_title') ->alias('a') ->where('a.id', $val['object_info']['first_id']) ->find()->toArray(); break; case 10: $val['object_info'] = \app\common\model\DatumComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\DatumUrl::field('a.id second_id,a.title second_title, b.id first_id,b.title first_title') ->alias('a') ->where('a.id', $val['object_info']['url_id']) ->leftJoin('DatumIntro b','b.id = a.datum_id') ->find()->toArray(); break; case 12: $val['object_info'] = ForumReplyComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = UserForum::field('a.id second_id,a.title second_title')->alias('a')->where('a.id', $val['object_info']['forum_id']) ->find()->toArray(); break; case 14: $val['object_info'] = \app\common\model\SupplierComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\SupplierGoods::field('a.id second_id,a.name second_title') ->alias('a') ->where('a.id', $val['object_info']['goods_id']) ->find()->toArray(); break; case 16: $val['object_info'] = \app\common\model\DemandComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\PlatformDemand::field('a.id second_id,a.title second_title') ->alias('a') ->where('a.id', $val['object_info']['demand_id']) ->find()->toArray(); break; case 17: $val['object_info'] = \app\common\model\DemandComment::where('id',$val['report_id'])->find()->toArray(); $val['be_report'] = \app\common\model\PlatformDemand::field('a.id second_id,a.title second_title') ->alias('a') ->where('a.id', $val['object_info']['first_id']) ->find()->toArray(); break; } }); } /** * 删除 * @auth true * @menu true */ public function del() { $this->_save($this->table, ['is_deleted' => 1]); } /** * 批量删除 * @auth true * @menu true */ public function remove() { $this->_save($this->table, ['is_deleted' => 1]); } /** * 回复 * @auth true * @menu true */ public function edit() { $this->title = '回复'; $this->_form($this->table,'form'); } protected function _form_filter(&$data) { if($this->request->action() == 'edit' && $this->request->isGet()) { $data['title'] = \app\common\model\ArticleIntro::where('id',$data['report_id'])->value('title'); } } }