12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace app\user\controller;
- use app\common\model\User;
- use app\common\model\VideoComment;
- use app\common\model\VideoIntro;
- use library\Controller;
- use think\Db;
- class UserReport extends Controller
- {
- protected $table ="UserReport";
-
- public function index()
- {
- $this->title = '举报列表';
- $where= [];
- if($this->request->request('name')) $where[]= ['m.name','like','%'.$this->request->request('phone').'%'];
- $where[]= ['f.is_deleted','=',0];
- $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();
- }
-
- 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 1:
- $val['object'] = VideoIntro::where('id',$val['report_id'])->field('id,cover,video_url,title')->find()->toArray();
- break;
- case 2:
- $val['object'] = VideoComment::where('id',$val['report_id'])->field('id,content,create_at')->find()->toArray();
- break;
- case 3:
- $val['object'] = User::where('id',$val['report_id'])->field('id,headimg,name')->find()->toArray();
- break;
- }
- });
- }
-
- public function del()
- {
- $this->_save($this->table, ['is_deleted' => 1]);
- }
-
- public function edit()
- {
- $this->title = '回复';
- $this->_form($this->table,'form');
- }
- }
|