view->fetch(); } public function confirmed_player(){ $user_id = $this->auth->id; $player = new Players(); $player_info = $player->where("member_id", $user_id)->find(); if (empty($player_info)){ $this->error(__("请先申请成为飞手!"), url('players/registeredflyers')) ; } if ($player_info['player_status'] != 9){ $this->error(__("您还不是正式飞手!"), url('user/index')); } } //飞手申诉 public function player_complain(){ $this->confirmed_player(); $user_id = $this->auth->id; $player = new Players(); $player_info = $player->where("member_id", $user_id)->find(); $complain_text = $this->request->param('complain_text'); $clubcomplain = new ClubComplain(); $complain_res = $clubcomplain->where('player_id',$player_info['id'])->find(); // if(!empty($complain_res)) $this->error('您已提交过申诉'); if(empty($complain_text)) $this->error("申诉内容不能为空"); $clubcomplain->save([ 'player_name' =>$player_info['real_name'], 'player_tel' => $player_info['phone'], 'player_id' => $player_info['id'], 'user_id' => $user_id, 'com_content'=> $complain_text, 'createtime' => time(), ]); $this->success('提交成功',url('players/index')); } }