diff --git a/Application/Admin/Controller/SupportController.class.php b/Application/Admin/Controller/SupportController.class.php index 5a036212b..4308c6b97 100644 --- a/Application/Admin/Controller/SupportController.class.php +++ b/Application/Admin/Controller/SupportController.class.php @@ -20,17 +20,21 @@ class SupportController extends ThinkController { if(I('game_id')){ $map['game_id']=I('game_id'); } - if(!empty(I('support_type')) || I('support_type')==='0'){ - $map['support_type']=I('support_type'); + if(!empty(I('apply_type')) || I('apply_type')==='0'){ + $map['apply_type']=I('apply_type'); + } + // + if(!empty(I('apply_status')) || I('apply_status')==='0'){ + $map['apply_status']=I('apply_status'); } /* 获取频道列表 */ - $list = M('support','tab_') - ->field('id,promote_id,promote_account,user_id,user_account,game_id,game_name,server_name,role_name,support_num,support_type,create_time,status,notice_status,remarks,real_support_num') + $list = M('test_resource','tab_') + ->field('*') ->where($map) ->order('id desc') ->page($page,$row) ->select(); - $count = M('support','tab_')->where($map)->count(); + $count = M('test_resource','tab_')->where($map)->count(); //分页 $page = set_pagination($count,$row); if($page) {$this->assign('_page', $page);} @@ -40,40 +44,45 @@ class SupportController extends ThinkController { $this->display(); } //改变审核状态 - public function change(){ - if (empty(I('id'))) { - $this->error('请选择要操作的数据!'); - } - $map['id']=I('id'); - $data['status']=I('status'); - $data['check_time']=time(); - $res=M('support','tab_')->where($map)->save($data); - if($res!==false){ - $this->success('操作成功'); - }else{ - $this->error('操作失败'); - } - } + // public function change(){ + // if (empty(I('id'))) { + // $this->error('请选择要操作的数据!'); + // } + // $map['id']=I('id'); + // $data['status']=I('status'); + // $data['check_time']=time(); + // $res=M('support','tab_')->where($map)->save($data); + // if($res!==false){ + // $this->success('操作成功'); + // }else{ + // $this->error('操作失败'); + // } + // } //通知渠道 public function notice_pro(){ if (empty(I('id'))) { $this->ajaxReturn(['status'=>0,'msg'=>'请选择要操作的数据!']); } - if( I('real_support_num') < 0){ + if( I('verify_resource') < 0){ $this->ajaxReturn(['status'=>0,'msg'=>'实际发放数量不正确!']); } $map['id']=I('id'); - $support=M('support','tab_')->field('support_num,status')->find($map['id']); - if($support['status'] !=2 ){ - $this->ajaxReturn(['status'=>0,'msg'=>'未审核通过!']); + + $support=M('test_resource','tab_')->field('apply_resource,apply_status')->find($map['id']); + if($support['apply_status'] !=0 ){ + $this->ajaxReturn(['status'=>0,'msg'=>'请勿重复提交!']); } - if($support['support_num'] < I('real_support_num') ){ + if($support['apply_resource'] < I('verify_resource') ){ $this->ajaxReturn(['status'=>0,'msg'=>'实际发放数量不能大于申请额度!']); } - $data['opinion']=I('opinion'); - $data['notice_status']=1; - $data['real_support_num']=I('real_support_num'); - $res=M('support','tab_')->where($map)->save($data); + + $data['verify_remark']=I('verify_remark'); + $data['verify_resource']=I('verify_resource'); + $data['verify_time']=time(); + $data['apply_status']=2; + + $res=M('test_resource','tab_')->where($map)->save($data); + if($res!==false){ $this->ajaxReturn(['status'=>1,'msg'=>'操作成功!']); }else{ @@ -86,29 +95,31 @@ class SupportController extends ThinkController { $this->ajaxReturn(['status'=>0,'msg'=>'请选择要操作的数据!']); } $map['id']=I('id'); - $support=M('support','tab_')->field('support_num,status')->find($map['id']); - $data['opinion']=I('opinion'); - $data['notice_status']=1; - $data['status']=0; - $data['check_time']=time(); - $res=M('support','tab_')->where($map)->save($data); + $support=M('test_resource','tab_')->field('verify_resource,apply_status')->find($map['id']); + if($support['apply_status'] !=0 ){ + $this->ajaxReturn(['status'=>0,'msg'=>'请勿重复提交!']); + } + $data['verify_remark']=I('verify_remark'); + $data['verify_time']=time(); + $data['apply_status']=1; + $res=M('test_resource','tab_')->where($map)->save($data); if($res!==false){ $this->ajaxReturn(['status'=>1,'msg'=>'操作成功!']); }else{ $this->ajaxReturn(['status'=>0,'msg'=>'操作失败!']); } } - //设置自动审核 - public function set_config_auto_audit($val='',$config_key='') - { - $config['value'] = $val; - $res = M('config')->where(array('name'=>$config_key))->save($config); - S('DB_CONFIG_DATA',null); - if($res !== false){ - $this->success('操作成功'); - }else{ - $this->error('操作失败'); - } - } + // //设置自动审核 + // public function set_config_auto_audit($val='',$config_key='') + // { + // $config['value'] = $val; + // $res = M('config')->where(array('name'=>$config_key))->save($config); + // S('DB_CONFIG_DATA',null); + // if($res !== false){ + // $this->success('操作成功'); + // }else{ + // $this->error('操作失败'); + // } + // } } diff --git a/Application/Admin/View/Support/lists.html b/Application/Admin/View/Support/lists.html index 1aeb4c3fd..344fc096d 100644 --- a/Application/Admin/View/Support/lists.html +++ b/Application/Admin/View/Support/lists.html @@ -39,7 +39,7 @@