field('tab_support.id,tab_support.role_name,tab_support.game_name,tab_support.promote_account,tab_support.create_time,user_account,role_name,server_name,freeze,user.device_number') ->join('left join tab_user as user on tab_support.user_id = user.id') ->where($map) ->page($page,$row) ->order('tab_support.create_time DESC') ->select(); foreach ($data as $key => $value) { $data[$key]['create_time'] = date('Y-m-d H:m:i',$value['create_time']); } $count = M('support','tab_') ->field('tab_support.role_name,tab_support.game_id,tab_support.promote_id,tab_support.create_time,user_account,role_name,server_name,freeze,user.device_number') ->join('left join tab_user as user on tab_support.user_id = user.id') ->where($map) ->select(); $count = count($count); $page = set_pagination($count,$row); if($page) {$this->assign('_page', $page);} $this->assign('data',$data); // var_dump($data); $this->display(); } public function freezeSupport() { $supportId = I('support_id', 0); if ($supportId == 0) { $this->ajaxReturn(['status'=>0,'msg'=>"参数错误"]); } $isFreeze = D('support')->froze($supportId); if ($isFreeze) { $this->ajaxReturn(['status'=>1, 'msg'=> '冻结成功']); } else { $this->ajaxReturn(['status'=>0, 'msg'=> '冻结失败']); } } public function unfreezeSupport() { $supportId = I('support_id', 0); if ($supportId == 0) { $this->ajaxReturn(['status'=>0,'msg'=>"参数错误"]); } $isFreeze = D('support')->unfreeze($supportId); if ($isFreeze) { $this->ajaxReturn(['status'=>1, 'msg'=> '启用成功']); } else { $this->ajaxReturn(['status'=>0, 'msg'=> '启用失败']); } } public function rechangePassward() { $supportId = I('support_id', 0); if ($supportId == 0) { $this->ajaxReturn(['status'=>0,'msg'=>"参数错误"]); } $passward = D('support')->rechangePassward($supportId); if ($passward) { $this->ajaxReturn(['status'=>1, 'msg'=> '新密码:'.$passward]); } else { $this->ajaxReturn(['status'=>0, 'msg'=> '重置密码失败']); } } /** * 获取区服列表 * @param $game_id */ public function getServer($game_id=""){ $map['game_id']=$game_id; $map['start_time']=['lt',time()]; if(I('status')==2){ $map['show_status']=1; } $data = M('server','tab_') ->field('tab_server.server_name,support_quota') ->where($map) ->join('join tab_game tg ON tg.id=tab_server.game_id') ->select(); $this->AjaxReturn($data); } }