| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666 |
- <?php
- /** 客服中心 -- 控制器
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2019/10/24
- * Time: 10:47
- */
- namespace app\mobile\controller;
- use think\Config;
- use think\Db;
- class Csc extends Mobile {
- private $_type
- = [
- '1' => '账号问题' ,
- '2' => '充值问题' ,
- '3' => '申诉问题' ,
- '4' => '人工服务' ,
- '5' => '其他' ,
- ];
- private $_appealMsgCode = 'SMS_192715035'; //'【麻花网络游戏】您正在申诉账号,验证码:[%s],有效期10分钟。请勿向任何人提供您收到的验证码。';
- /**
- * 初始化操作
- */
- protected function _initialize() {
- parent::_initialize();
- $this->cscModel = model('CpsProblem');
- }
- /**
- * 客服中心
- */
- public function index(){
- // 获取在线客服时间
- $kf_time = model('Setting')->getSetting('CUSTOMER_SERVICE_TIME');
- // 客服QQ列表
- $kefuList = model('Kefu')->getKefuList();
- $this->assign('kf_time',$kf_time);
- $this->assign('kefuList',$kefuList);
- return $this->fetch();
- }
- /**
- * 常见问题
- */
- public function question() {
- $type = $this->request->param('type' , 0 , 'intval');
- $typeArr = $this->_type;
- foreach ($typeArr as $k => $v) {
- $num = $this->judgeHasByType($k);
- if ( !$num) unset($typeArr[$k]);
- }
- $runable = true;
- if ( !$type || !isset($typeArr[$type])) {
- reset($typeArr);
- $type = key($typeArr);
- }
- if (( !count($typeArr) || !isset($typeArr[$type])) && $type != 0) {
- $runable = false;
- }
- $page_num = 10;
- if ($runable) {
- $list = Db::connect(config('database_slave'))->table('cy_csc_problem')->cache(Config::get('QUERY_RESULT_CACHE_TIME'))
- ->field('id,title,answer')
- ->where('type' , $type)
- ->order('order asc, create_time asc, id asc')
- ->paginate($page_num , false , array('query' => input('get.')));
- }
- if ($this->request->isAjax()) $this->jsonResult($runable ? $list : [],1);
- $this->assign('runable' , $runable);
- $this->assign('typeList' , $runable ? $typeArr : []);
- $this->assign('type' , $runable ? $type : 0);
- $this->assign('list' , $runable ? $list : []);
- $this->assign('current_num' , $runable ? count($list) ? ($list->toArray()['current_page'] - 1) * $page_num : 0 : 0);
- $this->assign('page' , $runable ? $list->render() : null);
- return $this->fetch();
- }
- /**
- * 判断 某个类型下 是否有问题
- */
- public function judgeHasByType($type) {
- $num = Db::connect(config('database_slave'))->table('cy_csc_problem')->cache(Config::get('QUERY_RESULT_CACHE_TIME'))->where('type' , $type)->count('id');
- return $num;
- }
- /**
- * w微信申诉页面
- */
- public function wechatAppeal() {
- return $this->fetch();
- }
- /**
- * 关注公众号页面
- */
- public function subscription() {
- return $this->fetch();
- }
- /**
- * 申诉查询
- */
- public function appealResult() {
- if ($this->request->isAjax()) {
- $code = $this->request->param('code');
- if ( !$code) $this->jsonResult([] , 0 , '请输入申诉编号');
- $Ticket = $this->request->param('ticket' , '' );
- $Randstr = $this->request->param('randstr' , '' );
- $slider = (new \app\home\controller\Member)->sliderVelidate($Ticket,$Randstr);
- if (!$slider['code']) $this->jsonResult([],0,$slider['msg']);
- $res = model('CscAppeal')
- ->field('id,userid,username,mobile,mail,status,code,certificate')
- ->where('code' , $code)->find();
- if (empty($res)) $this->jsonResult([] , 0 , '不存在该申诉编号');
- // 0:未审核 1:成功 2:失败 3:成功改完密码状态 4驳回',
- if ($res['status'] == 4) $res['status'] = 2;
- session('appeal_rest_pwd_info' , $res);
- if ( !empty($res['mobile'])) $res['mobile'] = stringObfuscation($res['mobile']);
- if ( !empty($res['mail'])) $res['mail'] = mailObfuscation($res['mail']);
- $this->success('',getMobileServiceUrl(3.1));
- }
- $appid = Config::get('SLIDER_VERIFICATION.APPID');
- $this->assign('appid',$appid);
- return $this->fetch();
- }
- /**
- * 申诉查询--结果页面
- */
- public function appealResultPage(){
- if (!session('appeal_rest_pwd_info')) $this->redirect(getServiceUrl(3,url('appealResult')));
- if ($this->request->isAjax()){
- $certificate = $this->request->param('certificate');
- if ( !$certificate) $this->jsonResult([] , 0 , '请输入成功凭证');
- $appealInfo = session('appeal_rest_pwd_info');
- if (empty($appealInfo) || $certificate != $appealInfo['certificate']) {
- $this->jsonResult([] , 0 , '成功凭证不正确');
- }
- $this->success('',getMobileServiceUrl(3.2));
- }
- $info = session('appeal_rest_pwd_info');
- /*$info['status'] = 1;*/
- $this->assign('info',$info);
- return $this->fetch();
- }
- /**
- * 通过申诉凭证 -- 充值密码页面
- */
- public function resetPwdPage() {
- if (!session('appeal_rest_pwd_info')) $this->redirect(getServiceUrl(3,url('appealResult')));
- return $this->fetch();
- }
- /**
- * 重置密码
- */
- public function resetPwd() {
- $appealInfo = session('appeal_rest_pwd_info');
- if (empty($appealInfo)) $this->jsonResult([] , 0 , '系统繁忙,请稍后再试');
- $password1 = input('post.password1' , '' );
- $password2 = input('post.password2' , '' );
- if (empty($password1)) $this->jsonResult([] , -1 , '请输入密码');
- if (empty($password2)) $this->jsonResult([] , -2 , '请再次输入密码');
- if ($password1 != $password2) $this->jsonResult([] , -2 , '两次输入的密码不一致');
- $userid = model('Members')->where(['username'=>$appealInfo['username']])->value('id');
- $memberCTR = new Member();
- $res = $memberCTR->resetPassword($userid , $password1,1);
- if ($res == 0) $this->jsonResult([] , -2 , '新密码不能与旧密码相同');
- if ($res == 3) $this->jsonResult([] , -1 , '请输入正确的密码,6-15位字符');
- if ($res == 2) $this->jsonResult([] , -2 , '密码重置失败,请稍后在试!');
- $result = model('CscAppeal')->save(['status' => 3] , ['id' => $appealInfo['id']]);
- session('appeal_rest_pwd_info' , null);
- if ($result || $appealInfo['status'] == 3) {
- $this->success('重置成功',getMobileCscUrl());
- }
- $this->error('重置失败');
- }
- /**
- * 账号申诉---确认申诉账号
- */
- public function appeal() {
- if (session('appeal')) {
- session('appeal' , null);
- }
- if ($this->request->isAjax()) {
- $username = input('post.username' , '' );
- $type = input('post.type' , '' );
- $number = input('post.number' , '' );
- $reason = input('post.reason' , '' , 'intval');
- $agreexy = input('post.reason' );
- $userid = session('front_userid'); //登录帐号id(不是申诉号码id)
- $typeArr = ['mobile' , 'email'];
- $data = [];
- if (empty($username)) $this->error('请输入申诉账号');
- if ( !in_array($type , $typeArr)) $this->error('请选择申诉接收方式');
- if ($type == $typeArr[0]) {
- $data['mobile'] = $number;
- if (empty($number)) $this->error('请输入手机号');
- if ( !$this->isMobile($number)) $this->error('请输入正确的手机号');
- }
- if ($type == $typeArr[1]) {
- $data['mail'] = $number;
- if (empty($number)) $this->error('请输入邮箱');
- if ( !$this->isEmail($number)) $this->error('请输入正确的邮箱');
- }
- if (empty($reason)) $this->error('请选择申诉原因');
- if (!$agreexy) $this->error('请先同意麻花网络服务使用协议');
- $condition['username'] = $username;
- $id = model('Members')->where($condition)->value('id');
- if (empty($id)) $this->error('帐号不存在');
- $data['userid'] = $userid;
- $result = Db::table('cy_csc_appeal')->where($condition)->select();
- if (!empty($result)){
- foreach ($result as $v){
- if ($v['status'] == 0) $this->error('该账号还有申诉处理中,请勿重复申诉');
- if ($v['status'] == 1) {
- $url = getMobileServiceUrl(3);
- $this->error('该账号有申诉已通过,但未重置密码,请前往<a href="' . $url . '" style="color:blue">"申诉查询"</a> 进行操作');
- }
- if (NOW_TIMESTAMP - $v['create_time'] <= 3600) $this->error('该账号距离上一次申诉未到1小时,请稍后再试,或联系麻花网络客服');
- }
- }
- if ($reason == 2) {
- $condition['status'] = ['in',['3',4]];
- $condition['reason'] = 2;
- $condition['create_time'] = ['egt' , NOW_TIMESTAMP - 180 * 24 * 60 * 60];
- $result = model('CscAppeal')->where($condition)->order('id desc')->find();
- if ($result['status'] == 3 || $result['status'] == 4) $this->error('该账号在近期已有账号被盗受理完成,不可再申诉,请联系麻花网络客服咨询');
- }
- $data['reason'] = $reason;
- $data['username'] = $username;
- session('appeal',$data);
- $this->success('',getMobileAppealUrl('check'));
- }
- return $this->fetch();
- }
- /**
- * 账号申诉---手机/邮箱验证
- */
- public function check(){
- if (!session('appeal')){
- $this->redirect(getMobileAppealUrl('zhss'));
- }
- $appid = Config::get('SLIDER_VERIFICATION.APPID');
- $this->assign('appid',$appid);
- $this->assign('info',session('appeal'));
- return $this->fetch();
- }
- /**
- * 账号申诉---发送验证码
- */
- public function sendCode(){
- $type = input('post.type' , '' );
- $info = session('appeal');
- $typeArr = ['mobile' , 'email'];
- if (!$info) $this->redirect(getMobileAppealUrl('zhss'));
- if (!in_array($type,$typeArr) || empty($info)) $this->error('非法请求');
- $Ticket = $this->request->param('ticket' , '' );
- $Randstr = $this->request->param('randstr' , '' );
- $slider = (new \app\home\controller\Member)->sliderVelidate($Ticket,$Randstr);
- if (!$slider['code']) $this->jsonResult([],0,$slider['msg']);
- if ($type == $typeArr[0]){
- $result = (new \app\common\library\Sms)->sendCode($info['mobile'],$this->_appealMsgCode);
- }else{
- $result = (new \app\common\library\Mail)->sendCodeMailByType($info['username'], $info['mail'],'appeal');
- }
- if(isset($result) && $result['status']){
- $this->jsonResult([],1,'发送成功');
- }else{
- $this->jsonResult([],0,$result['msg']);
- }
- }
- /**
- * 账号申诉---验证码验证
- */
- public function appealCheckCode(){
- $info = session('appeal');
- $code = input('post.code' , 0 , 'intval');
- $type = input('post.type' , '' );
- $typeArr = ['mobile' , 'email'];
- if ( !in_array($type , $typeArr) || empty($info)) $this->jsonResult([],0,'非法请求');
- if (empty($code)) $this->jsonResult([],0,'验证不能为空');
- if ($type == $typeArr[0]) {
- $result = (new \app\common\library\Sms)->checkCode($info['mobile'] , $code);
- } else {
- $result = (new \app\common\library\Mail)->checkCode($info['username'] , $info['mail'] , $code);
- }
- if ( isset($result) && $result['status']) {
- session('apeealHasCheck',true);
- $this->success('验证成功',getMobileAppealUrl('user'));
- }
- $this->jsonResult([],0,$result['msg']);
- }
- /**
- * 账号申诉---账号信息
- */
- public function appealAccount(){
- if(!session('apeealHasCheck')){
- $this->redirect(getMobileAppealUrl('check'));
- }
- if(session('apeealUserinfo')){
- session('apeealUserinfo',null);
- }
- /*$data = session('appeal');*/
- /*$province = Db::table('cy_city')->where('parent_id=1')->select();*/
- $gameWhere = [
- 'cooperation_status' => ['neq',0],
- 'nickname' => ['neq',''],
- ];
- $gamelist = model('Game')->field('id,nickname')->where($gameWhere)->group('nickname')->order('id desc')->select();
- /*$province = Db::table('cy_city')->where(['type'=>['in',[1,2]]])->select();*/
- /*dump($province);*/
- $province = $this->getAddr();
- $this->assign('province',json_encode($province));
- $this->assign('gamelist',$gamelist);
- return $this->fetch('appeal_account');
- }
- /**
- * 获取省份市
- */
- public function getAddr(){
- $province = Db::table('cy_city')->where(['type'=>['in',[1,2]]])->select();
- $provinceArr = array_filter($province,function ($v){
- if ($v['type'] == 1) return $v;
- });
- $cityArr = array_filter($province,function ($v){
- if ($v['type'] == 2) return $v;
- });
- $list = [];
- foreach ($provinceArr as $k => $value){
- $list[$k] = ['id'=>$value['id'], 'name'=>$value['name'], 'sub'=>[]];
- foreach ($cityArr as $item){
- if ($item['parent_id'] == $value['id']){
- $list[$k]['sub'][] = ['id'=>$item['id'], 'name'=>$item['name']];
- }
- }
- }
- return $list;
- }
- /**
- * 账号申诉---账号信息---提交
- */
- public function appealAccountTij(){
- $regtime = strtotime(input('post.regtime', ''));
- $imei = input('post.imei', '');
- $addr = input('post.addr', '');
- $reggameid = input('post.reggameid', '');
- $regmobile = input('post.regmobile', '');
- $totalrecharge = input('post.totalrecharge', '', 'intval');
- $firstrechargegameid = input('post.firstrechargegameid', '');
- if (empty($regtime)) $this->jsonResult('',-1,'请选择注册时间');
- /*if (!empty($imei)) {
- if (strlen($imei) != 15) {
- $this->jsonResult('',-2,'imei格式错误');
- }
- }*/
- if (empty($addr)) $this->jsonResult('',-3,'请选择注册地址');
- if (is_numeric($addr)) $this->jsonResult('',-3,'地址格式不能为数字');
- if ($reggameid == '') $this->jsonResult('',-4,'请选择注册游戏');
- if ( $firstrechargegameid == '') $this->jsonResult('',-5,'请选择首次充值游戏');
- if (!empty($regmobile)) {
- if ($regmobile == '无') {
- } else {
- if (!$this->isMobile($regmobile)) $this->jsonResult('',-6,'请输入正确的手机号');
- }
- }else{
- $this->jsonResult('',-6,'请输入注册时手机号');
- }
- if ($totalrecharge != 0 && empty($totalrecharge)) $this->jsonResult('',-7,'请输入累积充值金额');
- if (!is_numeric($totalrecharge)) $this->jsonResult('',-7,'请输入正确的金额');
- $data = session('appeal');
- $data['regtime'] = $regtime;
- $data['imei'] = $imei;
- $data['addr'] = $addr;
- $data['reggameid'] = $reggameid;
- if ($regmobile != '无') {
- $data['regmobile'] = $regmobile;
- }else{
- $data['regmobile'] = '';
- }
- $data['totalrecharge'] = $totalrecharge;
- $data['firstrechargegameid'] = $firstrechargegameid;
- if(session('apeealUserinfo')){
- session('apeealUserinfo',null);
- }
- session('apeealUserinfo',$data);
- $this->success('',getMobileAppealUrl('history'));
- }
- /**
- * 账号申诉---账号历史信息
- */
- public function appealHistory(){
- if (!session('apeealUserinfo')){
- $this->redirect(getMobileAppealUrl('user'));
- }
- $gameWhere = [
- 'cooperation_status' => ['neq',0],
- 'nickname' => ['neq',''],
- ];
- $gamelist = model('Game')->field('id,nickname')->where($gameWhere)->group('nickname')->order('id desc')->select();
- $this->assign('gamelist',$gamelist);
- return $this->fetch('appeal_history');
- }
- /**
- * 账号申诉---账号历史信息--提交
- */
- public function appealHistoryTij(){
- $regchannelname = $this->request->param('regchannelname', '');
- $oldmail = !empty($this->request->param('oldmail/a')) ? array_flip(array_flip(array_filter($this->request->param('oldmail/a')))) : [];
- $oldmobile = !empty($this->request->param('oldmobile/a')) ? array_flip(array_flip(array_filter($this->request->param('oldmobile/a')))) : [];
- $boundgameid = !is_null($this->request->param('boundgameid/a')) ? array_flip(array_flip(array_filter($this->request->param('boundgameid/a')))) : '';
- // 旧密码 充值时间 和 充值金额可能重复,不能用array_flip进行数组翻转(会过滤掉值一样的key)
- $rechargetime = !empty($this->request->param('rechargetime/a')) ? array_filter($this->request->param('rechargetime/a')) : [];
- $rechargeamount = !is_null($this->request->param('rechargeamount/a')) ? array_filter($this->request->param('rechargeamount/a')) : [];
- $oldpwd = !empty($this->request->param('oldpwd/a')) ? array_filter($this->request->param('oldpwd/a')) : [];
- if (empty($oldpwd)) {
- $this->jsonResult(0,-1,'密码不能为空');
- }else{
- $pwdpreg = '/^[a-zA-Z0-9]{6,15}$/';
- foreach ($oldpwd as $k => $oldpwdinfo) {
- if (0 == preg_match($pwdpreg, $oldpwdinfo)) {
- $this->jsonResult($k,-1,'密码长度为6-15位字符!');
- }
- }
- }
- if ( !empty($oldmail)) {
- foreach ($oldmail as $k => $oldmailinfo) {
- if (!empty($oldmailinfo) && !$this->isEmail($oldmailinfo)) $this->jsonResult($k,-2,'请输入正确的邮箱');
- }
- }
- if (!empty($oldmobile)) {
- foreach ($oldmobile as $k => $oldmobileinfo) {
- if (!empty($oldmobileinfo) && !$this->isMobile($oldmobileinfo)) $this->jsonResult($k,-3,'请输入正确的手机号');
- }
- }
- if (empty($rechargetime) && !empty($rechargeamount)) $this->jsonResult(0,-5,'请输入充值时间');
- if (!empty($rechargetime) && empty($rechargeamount)) $this->jsonResult(0,-6,'请输入累积充值金额');
- if (!empty($rechargeamount)) {
- foreach ($rechargeamount as $k => $rechargeamountinfo) {
- if (!isset($rechargetime[$k]) || empty($rechargetime[$k])) $this->jsonResult($k,-5,'请输入充值时间');
- if (!is_numeric($rechargeamountinfo)) $this->jsonResult($k,-6,'请输入正确的充值金额');
- }
- }
- if (!empty($rechargetime)) {
- foreach ($rechargetime as $k => $rechargetimeinfo) {
- if (!isset($rechargeamount[$k]) || !is_numeric($rechargeamount[$k])) $this->jsonResult($k,-6,'请输入正确的充值金额');
- if (empty($rechargetimeinfo)) $this->jsonResult($k,-5,'请输入充值时间');
- }
- }
- if ($boundgameid == '') $this->jsonResult(0,-7,'请选择登录过的游戏');
- if (!empty($boundgameid)) {
- foreach ($boundgameid as $k => $boundgameidinfo) {
- if (!is_numeric($boundgameidinfo)) $this->jsonResult($k,-7,'登录过的游戏数据出错');
- }
- }
- $regchannelid = model('Channel')->where(['name'=>$regchannelname])->value('id');
- $arr['oldpwd'] = serialize($oldpwd);
- $arr['oldmail'] = serialize($oldmail);
- $arr['oldmobile'] = serialize($oldmobile);
- $arr['boundgameid'] = serialize($boundgameid);
- $arr['rechargetime'] = serialize($rechargetime);
- $arr['rechargeamount'] = serialize($rechargeamount);
- $arr['regchannelid'] = $regchannelid;
- $arr['create_time'] = date('Y-m-d H:i:s',NOW_TIMESTAMP); // model('CscAppeal')->getAppealScore($data) 里面时间是日期格式
- $data = session('apeealUserinfo');
- $data = array_merge($data, $arr);
- // 判断是否已经申诉了,防止同时申诉
- $result = Db::table('cy_csc_appeal')->where(['username'=>$data['username'],'status'=>['in',[0,1,2]]])->select();
- $re_arr = [];
- if (!empty($result)){
- foreach ($result as $v){
- if ($v['status'] ==2 && (NOW_TIMESTAMP - $v['create_time'] <= 3600)) $this->error('该账号距离上一次申诉未到1小时,请稍后再试,或联系麻花网络客服');
- if ($v['status'] !=2 ) $re_arr[] = $v;
- }
- if (!empty($re_arr)) $this->error('该账号还有申诉处理中,请勿重复申诉');
- }
- $showtime = date("YmdHis", time());
- $data['code'] = $showtime . rand(0, 9); //申述编码
- $data['score'] = model('CscAppeal')->getAppealScore($data);
- $scoreLow = model('CscSetting')->where('name="MARK_APPEAL"')->value('value');
- $appealInfo = session('appeal');
- $data['reason'] = $appealInfo['reason']; //申述原因
- $data['userid'] = $appealInfo['userid'];
- $data['create_time'] = strtotime($data['create_time']); // 申诉时间
- $is_suc = true;
- if ($data['score'] < $scoreLow){
- $data['status'] = 2;
- $data['operate_time'] = NOW_TIMESTAMP;
- $data['operate_id'] = 1;
- $data['notice_time'] = $data['create_time'];
- $is_suc = false;
- if (isset($appealInfo['mobile']) && !empty($appealInfo['mobile'])){
- $result = (new \app\common\library\Sms)->sendAppealCode($appealInfo['username'],$data['code'],$appealInfo['mobile'],'','',4);
- }elseif(isset($appealInfo['mail']) && !empty($appealInfo['mail'])){
- $result = (new \app\common\library\Mail)->sendAppealCodeMail($appealInfo['username'], $data['code'],$appealInfo['mail'],'','',4);
- }
- if(isset($result) && $result['status']){
- $data['is_finish'] = 1;
- }else{
- $data['remark'] = '短信发送失败:'.$result['msg'];
- }
- }else{
- if ($data['reason'] == 2) {
- // 清空手机和邮箱
- $update = [
- 'flag' => 1 ,
- 'email' => '' ,
- 'mobile' => '' ,
- ];
- model('Members')->save($update,['username' => $appealInfo['username']]);
- // 记录用户冻结历史记录
- $userid = model('Members')->where(['username' => $appealInfo['username']])->value('id');
- model('FrozenHistory')->addData($userid,1,0);
- }
- if (isset($appealInfo['mobile']) && !empty($appealInfo['mobile'])){
- $data['notice_time'] = $data['create_time'] + 86400 * 3;
- $result = (new \app\common\library\Sms)->sendAppealCode($appealInfo['username'],$data['code'],$appealInfo['mobile'],'三','',0);
- }elseif(isset($appealInfo['mail']) && !empty($appealInfo['mail'])){
- $data['notice_time'] = $data['create_time'] + 3600 * 6;
- $result = (new \app\common\library\Mail)->sendAppealCodeMail($appealInfo['username'], $data['code'],$appealInfo['mail'],'一','',0);
- }
- }
- $appealId = model('CscAppeal')->insertGetId($data);
- if ($appealId) {
- session('appealResult',['username'=>$appealInfo['username'],'code'=>$data['code'],'status'=>$is_suc]);
- $this->success('',getMobileAppealUrl('result'));
- }
- $this->error('系统繁忙,请稍后再试!');
- }
- /**
- * 申诉结果
- */
- public function appealEnding(){
- $info = session('appealResult');
- session('apeealUserinfo',null);
- session('apeeal',null);
- session('apeealHasCheck',null);
- $this->assign('info',$info);
- return $this->fetch();
- }
- public function ajaxGameList($keyword='')
- {
- $gameWhere = [
- 'cooperation_status' => ['neq',0],
- 'nickname' => ['neq',''],
- ];
- if ( !empty($keyword)) {
- $gameWhere['nickname'] = ['like',"%".$keyword."%"];
- }
- $list = model('Game')->field('id,nickname')->where($gameWhere)->group('nickname')->order('id desc')
- ->select();
- $type = $this->request->param('type', '');
- if (empty($type)){
- if($keyword == '' || strpos('麻花网络官网注册',$keyword) !== false){
- $arr = [['id'=>0,'nickname'=>'麻花网络官网注册']];
- $list = array_merge($arr,$list);
- }
- }elseif ($type == 'pay'){
- $list = array_merge([['id'=>0,'nickname'=>'无']],$list);
- }
- return ['list'=>$list];
- }
-
- }
|