title = '举报列表'; $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','=',5]; $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'); $object_info = ArticleIntro::where('id',$val['report_id'])->find()->toArray(); $val['object_type'] = $object_info['type']; $val['object_title'] = $object_info['title']; }); } /** * 删除反馈日志 * @auth true * @menu true */ public function del() { $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'); } } }