12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- namespace app\operate\controller;
- use app\common\model\DatumIntro;
- use app\common\model\UserForum;
- use library\Controller;
- use think\Db;
- /**
- * 举报
- * Class ForumReport
- * @package app\operate\controller
- */
- class ForumReport extends Controller
- {
- protected $table ="UserReport";
- /**
- * 反馈变更列表
- * @auth true
- * @menu true
- */
- public function index()
- {
- $this->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','=',6];
- $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 = UserForum::where('id',$val['report_id'])->find();
- $object_info = $object_info ? $object_info->toArray() : ['title'=>'--'];
- $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 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'] = UserForum::where('id',$data['report_id'])->value('title');
- }
- }
- }
|