测试功能移交到总管理后台,扶持号管理bug修正
parent
18cddff9a4
commit
f64225cff0
@ -0,0 +1,627 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
use Base\Model\PromoteModel;
|
||||
use Admin\Model\TestResourceModel;
|
||||
use Base\Service\PromoteService;
|
||||
use OSS\Core\OssException;
|
||||
|
||||
|
||||
class TestResourceController extends ThinkController
|
||||
{
|
||||
public function test(){
|
||||
echo 'test1';
|
||||
}
|
||||
|
||||
public function supportNumberList($p = 1) {
|
||||
$page = intval($p);
|
||||
$page = $page ? $page : 1; //默认显示第一页数据
|
||||
$row=10;
|
||||
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
|
||||
|
||||
$map = [];
|
||||
if(!empty(I('server_name'))){
|
||||
$map['tab_test_resource.server_name']=I('server_name');
|
||||
}
|
||||
if(!empty(I('game_name'))){
|
||||
$map['tab_test_resource.game_name']=I('game_name');
|
||||
}
|
||||
if(!empty(I('role_name'))){
|
||||
$map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
|
||||
}
|
||||
if(!empty(I('user_account'))){
|
||||
$map['tab_test_resource.user_account']=I('user_account');
|
||||
}
|
||||
if(!empty(I('promote_name'))){
|
||||
$map['tab_test_resource.promote_account']=I('promote_name');
|
||||
}
|
||||
|
||||
$data = M('test_resource','tab_')
|
||||
->field('tab_test_resource.id,tab_test_resource.user_id,tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,check_status')
|
||||
->join('left join tab_user as user on tab_test_resource.user_id = user.id')
|
||||
->where($map)
|
||||
->page($page,$row)
|
||||
->order('tab_test_resource.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('test_resource','tab_')
|
||||
->field('tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,check_status')
|
||||
->join('left join tab_user as user on tab_test_resource.user_id = user.id')
|
||||
->where($map)
|
||||
->select();
|
||||
$count = count($count);
|
||||
|
||||
$page = set_pagination($count,$row);
|
||||
if($page) {$this->assign('_page', $page);}
|
||||
$this->meta_title = '扶持号管理';
|
||||
$this->assign('data',$data);
|
||||
|
||||
$this->display();
|
||||
|
||||
}
|
||||
|
||||
public function freezeSupport() {
|
||||
$supportId = I('support_id', 0);
|
||||
if ($supportId == 0) {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>"参数错误"]);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'check_status' => 0
|
||||
];
|
||||
|
||||
$isFreeze = M('user','tab_')->where("id=".$supportId)->save($data);
|
||||
|
||||
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'=>"参数错误"]);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'check_status' => 1
|
||||
];
|
||||
|
||||
$isFreeze = M('user','tab_')->where("id=".$supportId)->save($data);
|
||||
|
||||
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'=>"参数错误"]);
|
||||
}
|
||||
|
||||
$password = $this->getRandomPassword(6);
|
||||
$data = [
|
||||
'password' => md5(sha1($password) . UC_AUTH_KEY)
|
||||
];
|
||||
|
||||
$passward = M('user','tab_')->where("id=".$supportId)->save($data);
|
||||
if ($passward) {
|
||||
$this->ajaxReturn(['status'=>1, 'msg'=> '新密码:'.$password]);
|
||||
} else {
|
||||
$this->ajaxReturn(['status'=>0, 'msg'=> '重置密码失败']);
|
||||
}
|
||||
}
|
||||
|
||||
private function getRandomPassword($length, $special = true){
|
||||
$chars = array(
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
|
||||
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
|
||||
'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
|
||||
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2',
|
||||
'3', '4', '5', '6', '7', '8', '9'
|
||||
);
|
||||
|
||||
// if($special){
|
||||
// $chars = array_merge($chars, array(
|
||||
// '!', '@', '#', '$', '?', '|', '{', '/', ':', ';',
|
||||
// '%', '^', '&', '*', '(', ')', '-', '_', '[', ']',
|
||||
// '}', '<', '>', '~', '+', '=', ',', '.'
|
||||
// ));
|
||||
// }
|
||||
|
||||
$charsLen = count($chars) - 1;
|
||||
shuffle($chars);
|
||||
|
||||
$password = '';
|
||||
for($i=0; $i<$length; $i++){
|
||||
$password .= $chars[mt_rand(0, $charsLen)];
|
||||
}
|
||||
return $password;
|
||||
}
|
||||
|
||||
public function protectLogList($p = 1) {
|
||||
$promote_id = get_pid();
|
||||
$page = intval($p);
|
||||
$page = $page ? $page : 1; //默认显示第一页数据
|
||||
$row=10;
|
||||
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
|
||||
|
||||
$map = [];
|
||||
if(!empty(I('server_name'))){
|
||||
$map['server_name']=I('server_name');
|
||||
}
|
||||
if(!empty(I('game_name'))){
|
||||
$map['game_name']=I('game_name');
|
||||
}
|
||||
if(!empty(I('nickname'))){
|
||||
$map['nickname']=['like','%'.I('nickname').'%'];
|
||||
}
|
||||
if(!empty(I('user_account'))){
|
||||
$map['user_account']=I('user_account');
|
||||
}
|
||||
if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('GT',strtotime($_REQUEST['start']));
|
||||
unset($_REQUEST['start']);
|
||||
}
|
||||
if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1);
|
||||
unset($_REQUEST['end']);
|
||||
}
|
||||
if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
|
||||
unset($_REQUEST['start']);unset($_REQUEST['end']);
|
||||
}
|
||||
if(!empty(I('types'))){
|
||||
$map['type']=I('types');
|
||||
}
|
||||
|
||||
$field = 'id,game_name,server_name,user_account,nickname,promote_account,detail';
|
||||
$order = 'id DESC';
|
||||
|
||||
$data = D('protect_log')->getProtectLog($field,$map,'',$order,$page,$row);
|
||||
|
||||
$count = D('protect_log')->getProtectLog($field,$map,'',$order);
|
||||
|
||||
M('protect_log_read', 'tab_')->startTrans(); //事物
|
||||
try {
|
||||
$arrUserId = array_column($data,'id');
|
||||
$logId = implode(',',$arrUserId);
|
||||
|
||||
$logRead = M('protect_log_read','tab_')
|
||||
->where("log_id IN({$logId}) and promote_id = {$promote_id}")
|
||||
->select();
|
||||
|
||||
$upsetData = array_column($logRead,'log_id');
|
||||
|
||||
$addData = [];
|
||||
$k = 0;
|
||||
foreach($arrUserId as $key => $value) {
|
||||
if (in_array($value['id'],$upsetData)) {
|
||||
continue;
|
||||
} else {
|
||||
$addData[$k]['log_id'] = $value;
|
||||
$addData[$k]['promote_id'] = $promote_id;
|
||||
$addData[$k]['create_time'] = time();
|
||||
$k++;
|
||||
}
|
||||
}
|
||||
|
||||
M('protect_log_read','tab_')->addAll($addData);
|
||||
|
||||
} catch (OssException $e) {
|
||||
M('protect_log_read', 'tab_')->rollback();//回滚
|
||||
}
|
||||
M('protect_log_read', 'tab_')->commit(); //提交事物
|
||||
|
||||
$count = count($count);
|
||||
$page = set_pagination($count,$row);
|
||||
$this->meta_title = '日志管理';
|
||||
if($page) {$this->assign('_page', $page);}
|
||||
|
||||
$this->assign('data',$data);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
protected function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$map['id'] = get_pid();
|
||||
$pro = M("promote", "tab_")->where($map)->find();
|
||||
if ($pro['parent_id']!=0) {
|
||||
$this->error('无权操作!');
|
||||
}
|
||||
}
|
||||
|
||||
public function index($p=0)
|
||||
{
|
||||
$page = intval($p);
|
||||
$page = $page ? $page : 1; //默认显示第一页数据
|
||||
$row=10;
|
||||
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
|
||||
$map =array();
|
||||
if(!empty(I('role_name'))){
|
||||
$map['role_name']=['like','%'.I('role_name').'%'];
|
||||
}
|
||||
if(!empty(I('server_name'))){
|
||||
$map['server_name']=I('server_name');
|
||||
}
|
||||
if(!empty(I('game_name'))){
|
||||
$map['game_name']=I('game_name');
|
||||
}
|
||||
if(!empty(I('user_account'))){
|
||||
$map['user_account']=['like','%'.I('user_account').'%'];
|
||||
}
|
||||
if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('GT',strtotime($_REQUEST['start']));
|
||||
unset($_REQUEST['start']);
|
||||
}
|
||||
if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1);
|
||||
unset($_REQUEST['end']);
|
||||
}
|
||||
if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
|
||||
unset($_REQUEST['start']);unset($_REQUEST['end']);
|
||||
}
|
||||
//
|
||||
$res = D("test_resource")->getResourceCout($map,$page,$row);
|
||||
// dump($res);
|
||||
$parameter =I('get.');
|
||||
$parameter['p']=I('get.p',1);
|
||||
$parameter['row']=I('get.row');
|
||||
|
||||
|
||||
$page = set_pagination($res["count"],$row,$parameter);
|
||||
if($page) {$this->assign('_page', $page);}
|
||||
// var_dump($res['list']);die();
|
||||
$this->meta_title = '测试资源';
|
||||
$this->m_title = '测试资源申请';
|
||||
$this->assign('data',$res['list']);
|
||||
$this->assign('count',$res["count"]);
|
||||
$this->display();
|
||||
# code...
|
||||
}
|
||||
/**
|
||||
* 获取区服列表
|
||||
* @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.id,tab_server.server_name,support_quota')
|
||||
->where($map)
|
||||
->join('join tab_game tg ON tg.id=tab_server.game_id')
|
||||
->select();
|
||||
|
||||
$this->AjaxReturn($data);
|
||||
}
|
||||
//获取当前和当前子渠道的渠道id
|
||||
public function get_all_promote(){
|
||||
$pro_id=get_prmoote_chlid_account(get_pid());
|
||||
// var_dump($pro_id);die();
|
||||
foreach ($pro_id as $key => $value) {
|
||||
$pro_id1[]=$value['id'];
|
||||
}
|
||||
if(!empty($pro_id1)){
|
||||
$pro_id2=array_merge($pro_id1,array(get_pid()));
|
||||
}else{
|
||||
$pro_id2=array(get_pid());
|
||||
}
|
||||
return $pro_id2;
|
||||
}
|
||||
/**
|
||||
* 系统非常规MD5加密方法
|
||||
* @param string $str 要加密的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function think_ucenter_md5($str, $key = 'ThinkUCenter'){
|
||||
return '' === $str ? '' : md5(sha1($str) . $key);
|
||||
}
|
||||
//新增扶持
|
||||
public function add()
|
||||
{
|
||||
// dump(I('post.'));
|
||||
if (IS_POST) {
|
||||
$count=count(I('user_account'));
|
||||
session('apply_status', 0);
|
||||
|
||||
(empty(I('server_id')) || I('server_id')<1) && $this->error('请选择区服!');;
|
||||
M('test_resource', 'tab_')->startTrans(); //事物
|
||||
for ($i=0; $i < $count ; $i++) {
|
||||
$i_account=I('user_account')[$i];
|
||||
if (!empty($i_account)) {
|
||||
$user=M('user', 'tab_')->field('promote_id,password,phone')->where(['account'=>$i_account])->find();
|
||||
$promote = $this->get_all_promote();
|
||||
if (!in_array($user['promote_id'], $promote)) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error($i_account.'账号不存在');
|
||||
}
|
||||
if (empty(I('user_password')[$i])) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error(I('user_account')[$i].'请输入密码');
|
||||
}
|
||||
if ($user['password']!=$this->think_ucenter_md5(I('user_password')[$i], UC_AUTH_KEY)) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error($i_account.'密码不正确');
|
||||
}
|
||||
if (empty(I('role_name')[$i])) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error(I('user_account')[$i].'请输入角色名');
|
||||
}
|
||||
|
||||
$supportNum = I('apply_resource')[$i];
|
||||
if (empty($supportNum)) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error(I('user_account')[$i].'请输入资源数量');
|
||||
}
|
||||
if ($supportNum<0 || !preg_match('/^[1-9]\d*$/', $supportNum)) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error(I('user_account')[$i].'请输入资源数量');
|
||||
}
|
||||
|
||||
|
||||
$map['game_id']=I('game_id');
|
||||
$map['server_id']=I('server_id');
|
||||
$map['user_account']=I('user_account')[$i];
|
||||
// $map['apply_status']=['neq',0];
|
||||
$map['apply_type']=0;
|
||||
$list= M('test_resource', 'tab_')->where($map)->find();
|
||||
if ($list) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error(I('user_account')[$i].'账号已存在');
|
||||
}
|
||||
|
||||
// $support_quota = M('game', 'tab_')->field('support_quota')->find(get_game_id(I('game_name')));
|
||||
// if ($support_quota['support_quota'] < I('support_num')[$i]) {
|
||||
// M('test_resource', 'tab_')->rollback();//回滚
|
||||
// $this->ajaxReturn(['msg'=>'超出申请额度' ,'status'=>0]);
|
||||
// }
|
||||
|
||||
$data['game_id']=I('game_id');
|
||||
$data['game_name']=I('game_name');
|
||||
$data['server_id']=I('server_id');
|
||||
$data['server_name']=I('server_name');
|
||||
$data['user_account']=I('user_account')[$i];
|
||||
$data['user_id']=get_user_id(I('user_account')[$i]);
|
||||
$data['user_password']=base64_encode(I('user_password')[$i]);
|
||||
$data['phone']=$user['phone'];
|
||||
$data['role_name']=I('role_name')[$i];
|
||||
|
||||
|
||||
$data['apply_resource']=I('apply_resource')[$i];
|
||||
$data['apply_remark']=I('apply_remark')[$i];
|
||||
|
||||
$data['apply_name']=$_SESSION['onethink_home']['promote_auth']['account'];
|
||||
$data['apply_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
|
||||
|
||||
// $data['promote_id']=session("promote_auth.pid");
|
||||
// $data['promote_account']=session("promote_auth.account");
|
||||
|
||||
$data['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
|
||||
$data['promote_account']=$_SESSION['onethink_home']['promote_auth']['account'];
|
||||
|
||||
$data['create_time']=time();
|
||||
$data['apply_type']=0;
|
||||
|
||||
$model = M('test_resource', 'tab_')->add($data);
|
||||
if ($model) {
|
||||
session('apply_status', 1);
|
||||
}
|
||||
} else {
|
||||
if (I('user_password')[$i]) {
|
||||
M('test_resource', 'tab_')->rollback();//回滚
|
||||
$this->error('请输入账号');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (session('apply_status')==0) {
|
||||
session('apply_status', null);
|
||||
$this->error('请输入账号');
|
||||
}
|
||||
M('test_resource', 'tab_')->commit(); //提交事物
|
||||
$this->success('添加成功',U('TestResource/index'));
|
||||
} else {
|
||||
$this->meta_title = '新增测试账号';
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
public function edit() {
|
||||
|
||||
$id = I('id');
|
||||
//获取数据
|
||||
$data = M('test_resource','tab_')->where("id={$id}")->find();
|
||||
if (!$data) {
|
||||
$this->error('数据不存在!');
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->assign('data', $data);
|
||||
$this->meta_title = '编辑礼包';
|
||||
|
||||
$this->m_title = '礼包列表';
|
||||
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
//修改申请
|
||||
public function apply_edit(){
|
||||
$user=M('user','tab_')->field('password')->where(['account'=>I('user_account')])->find();
|
||||
if($user['password'] !== $this->think_ucenter_md5(I('user_password'), UC_AUTH_KEY)){
|
||||
$this->error('修改失败,密码不正确!');
|
||||
}
|
||||
|
||||
$data['user_password']=base64_encode(I('user_password'));
|
||||
$data['role_name']=I('role_name');
|
||||
$map = I("post.");
|
||||
unset($map['user_password']);
|
||||
unset($map['role_name']);
|
||||
$res=M('test_resource','tab_')->where($map)->save($data);
|
||||
if($res===false){
|
||||
$this->error('更新失败');
|
||||
}else{
|
||||
$this->success('更新成功', U('index'));
|
||||
}
|
||||
}
|
||||
//后续申请
|
||||
public function apply(){
|
||||
$ids = explode(',', I('id'));
|
||||
|
||||
foreach ($ids as $key => $value) {
|
||||
$map['id']=$value;
|
||||
$support=M('test_resource','tab_')->field('promote_id')->where($map)->find();
|
||||
// if($support['promote_id'] !=session("promote_auth.pid") || empty($support) ){
|
||||
// $this->error('数据错误');
|
||||
// }
|
||||
}
|
||||
$this->m_title = '推广员列表';
|
||||
$this->meta_title = '申请后续';
|
||||
$this->display();
|
||||
}
|
||||
//申请新增扶持(单个或批量申请)
|
||||
public function batch_apply(){
|
||||
$ids = explode(',', I('id'));
|
||||
|
||||
M('test_resource','tab_')->startTrans(); //事物
|
||||
foreach ($ids as $key => $value) {
|
||||
|
||||
$map['id']=$value;
|
||||
$support=M('test_resource','tab_')->where($map)->find();
|
||||
if(I('apply_resource') <0 || !preg_match('/^[1-9]\d*$/', I('apply_resource', 0))){
|
||||
M('test_resource','tab_')->rollback();//回滚
|
||||
$this->error('申请资源数量有误');
|
||||
}
|
||||
if(empty($support)){
|
||||
M('test_resource','tab_')->rollback();//回滚
|
||||
$this->error('数据有误');
|
||||
}
|
||||
|
||||
// $max_quota=$this->max_quota($support['game_id'],$support['server_name']);//最大申请额度
|
||||
// if(count($ids)>1){
|
||||
// $map_s['game_id']=$support['game_id'];
|
||||
// $map_s['server_name']=$support['server_name'];
|
||||
// $map_s['id'] =['in',$ids];
|
||||
// $count=M('support','tab_')->where($map_s)->count();
|
||||
// $max_quota = floor($max_quota/$count);
|
||||
// }
|
||||
// if(I('support_num') > $max_quota){
|
||||
// M('support','tab_')->rollback();//回滚
|
||||
// $this->ajaxReturn(['status'=>0,'msg'=>'扶持申请额度不足,最大额度:'.$max_quota]);
|
||||
// }
|
||||
|
||||
if($support['promote_id'] !=$_SESSION['onethink_home']['promote_auth']['pid'] || empty($support) ){
|
||||
M('test_resource','tab_')->rollback();//回滚
|
||||
$this->error('申请失败');
|
||||
}
|
||||
|
||||
$data['game_id']=$support['game_id'];
|
||||
$data['game_name']=$support['game_name'];
|
||||
$data['server_id']=$support['server_id'];
|
||||
$data['server_name']=$support['server_name'];
|
||||
$data['user_account']=$support['user_account'];
|
||||
$data['user_id']=$support['user_id'];
|
||||
$data['user_password']=$support['user_password'];
|
||||
$data['phone']=$support['phone'];
|
||||
$data['role_name']=$support['role_name'];
|
||||
|
||||
|
||||
$data['apply_resource']=I('apply_resource');
|
||||
$data['apply_remark']=I('apply_remark');
|
||||
|
||||
$data['apply_name']=$_SESSION['onethink_home']['promote_auth']['account'];
|
||||
$data['apply_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
|
||||
|
||||
// $data['promote_id']=session("promote_auth.pid");
|
||||
// $data['promote_account']=session("promote_auth.account");
|
||||
$data['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
|
||||
$data['promote_account']=$_SESSION['onethink_home']['promote_auth']['account'];
|
||||
|
||||
$data['create_time']=time();
|
||||
$data['apply_type']=1;
|
||||
//
|
||||
$model = M('test_resource','tab_')->add($data);
|
||||
if($model===false){
|
||||
M('test_resource','tab_')->rollback();//回滚
|
||||
$this->error('申请失败');
|
||||
}else{
|
||||
//成功
|
||||
}
|
||||
}
|
||||
M('test_resource','tab_')->commit(); //提交事物
|
||||
$this->success('申请成功',U('index'));
|
||||
}
|
||||
public function lists( $p = 1){
|
||||
$page = intval($p);
|
||||
$page = $page ? $page : 1; //默认显示第一页数据
|
||||
$row=10;
|
||||
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
|
||||
|
||||
if(!empty(I('type'))||I('type')==='0'){
|
||||
$map['apply_status']=I('type');
|
||||
}
|
||||
|
||||
if(!empty(I('role_name'))){
|
||||
$map['role_name']=['like','%'.I('role_name').'%'];
|
||||
}
|
||||
if(!empty(I('server_name'))){
|
||||
$map['server_name']=I('server_name');
|
||||
}
|
||||
if(!empty(I('game_name'))){
|
||||
$map['game_name']=I('game_name');
|
||||
}
|
||||
if(!empty(I('user_account'))){
|
||||
$map['user_account']=['like','%'.I('user_account').'%'];
|
||||
}
|
||||
if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('GT',strtotime($_REQUEST['start']));
|
||||
unset($_REQUEST['start']);
|
||||
}
|
||||
if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1);
|
||||
unset($_REQUEST['end']);
|
||||
}
|
||||
if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){
|
||||
$map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
|
||||
unset($_REQUEST['start']);unset($_REQUEST['end']);
|
||||
}
|
||||
|
||||
$map['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
|
||||
$data=M('test_resource','tab_')->where($map)->order('id desc')->page($page,$row)->select();
|
||||
$count=M('test_resource','tab_')->field('id')->where($map)->select();
|
||||
$count = count($count);
|
||||
|
||||
$parameter = I("get.");
|
||||
$parameter['p']=I('get.p',1);
|
||||
$parameter['row']=I('get.row');
|
||||
|
||||
|
||||
$page = set_pagination($count,$row,$parameter);
|
||||
if($page) {$this->assign('_page', $page);}
|
||||
|
||||
$this->meta_title = '测试资源申请记录';
|
||||
$this->assign('data',$data);
|
||||
$this->assign('count',$count);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | OneThink [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace Admin\Model;
|
||||
use Think\Model;
|
||||
|
||||
/**
|
||||
* 分类模型
|
||||
*/
|
||||
class ProtectLogModel extends Model{
|
||||
|
||||
protected $_validate = array(
|
||||
|
||||
);
|
||||
|
||||
protected $_auto = array(
|
||||
);
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param string $name 模型名称
|
||||
* @param string $tablePrefix 表前缀
|
||||
* @param mixed $connection 数据库连接信息
|
||||
*/
|
||||
public function __construct($name = '', $tablePrefix = '', $connection = '') {
|
||||
/* 设置默认的表前缀 */
|
||||
$this->tablePrefix ='tab_';
|
||||
/* 执行构造方法 */
|
||||
parent::__construct($name, $tablePrefix, $connection);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按照时间分组统计注册总数
|
||||
* @param string $field 需要的字段
|
||||
* @param string $where sql条件
|
||||
* @param string $group sqlGroup条件
|
||||
* @param string $order sql排序
|
||||
* @param string $page 页数
|
||||
* @param string $row 每页几条
|
||||
* @return array 详细数据
|
||||
* @author 鹿文学
|
||||
*/
|
||||
public function getProtectLog($field = '*', $where = [], $group = '', $order='',$page = 0, $row = 0) {
|
||||
|
||||
if ($page) {
|
||||
$data = $this->field($field)
|
||||
->where($where)
|
||||
->page($page,$row)
|
||||
->group($group)
|
||||
->order($order)
|
||||
->select();
|
||||
} else {
|
||||
$data = $this->field($field)
|
||||
->where($where)
|
||||
->group($group)
|
||||
->order($order)
|
||||
->select();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | OneThink [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace Admin\Model;
|
||||
use Think\Model;
|
||||
|
||||
/**
|
||||
* 分类模型
|
||||
*/
|
||||
class TestResourceModel extends Model{
|
||||
/**
|
||||
* 构造函数
|
||||
* @param string $name 模型名称
|
||||
* @param string $tablePrefix 表前缀
|
||||
* @param mixed $connection 数据库连接信息
|
||||
*/
|
||||
public function __construct($name = '', $tablePrefix = '', $connection = '') {
|
||||
/* 设置默认的表前缀 */
|
||||
$this->tablePrefix ='tab_';
|
||||
/* 执行构造方法 */
|
||||
parent::__construct($name, $tablePrefix, $connection);
|
||||
}
|
||||
/**
|
||||
* 获取统计 $map,$page,$row
|
||||
*/
|
||||
public function getResourceCout($map,$page,$row) {
|
||||
$promote_id=session("promote_auth.pid");
|
||||
//获取基本信息
|
||||
$res = $this
|
||||
->table("tab_test_resource as test")
|
||||
->field("test.*,user.check_status")
|
||||
->join('tab_user user on test.user_id=user.id','left')
|
||||
->page($page,$row)
|
||||
->order("create_time desc")
|
||||
->where($map)
|
||||
->group("user_id,game_id,server_id")
|
||||
->select();
|
||||
//获取统计
|
||||
|
||||
if(empty($res)){
|
||||
return $res;
|
||||
}
|
||||
$rescount = $this
|
||||
->where($map)
|
||||
->group("user_id,game_id,server_id")
|
||||
->buildSql();
|
||||
$rescount = $this->table($rescount.' a')->count();
|
||||
//生成idstr
|
||||
foreach ($res as $key => $value) {
|
||||
$value['create_time'] = date("Y-m-d H:i:s", $value['create_time']);
|
||||
//获取累计发放
|
||||
$where = array(
|
||||
"user_id"=>$value['user_id'],
|
||||
"game_id"=>$value['game_id'],
|
||||
"server_id"=>$value['server_id']
|
||||
);
|
||||
$where1 = array(
|
||||
"apply_status"=>2,
|
||||
);
|
||||
//获取累计
|
||||
$verify_resource = $this->field("IFNULL(sum(verify_resource),0) verify_resource_count,count(*) verify_count")->where(array_merge($where,$where1))->find();
|
||||
//获取申请
|
||||
$where2 = array(
|
||||
"apply_status"=>0,
|
||||
);
|
||||
$apply_resource = $this->field("IFNULL(sum(apply_resource),0) apply_resource_count")->where(array_merge($where,$where2))->find();
|
||||
$res[$key] = array_merge($value,$verify_resource,$apply_resource);
|
||||
}
|
||||
return array("list"=>$res,"count"=>$rescount);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,252 @@
|
||||
<extend name="Public/base" />
|
||||
|
||||
<block name="css">
|
||||
<!-- <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all"> -->
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/jquery-1.7.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
|
||||
<style>
|
||||
#form .txt_area.download_url {width:400px;}
|
||||
.tabcon1711 .table_radio2 .table_btn {width:215px;}
|
||||
</style>
|
||||
</block>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
|
||||
<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.tabcon1711 .select2-container--default .select2-selection--single{
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
vertical-align: middle;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
|
||||
-webkit-transition: border linear .2s, box-shadow linear .2s;
|
||||
-moz-transition: border linear .2s, box-shadow linear .2s;
|
||||
-o-transition: border linear .2s, box-shadow linear .2s;
|
||||
transition: border linear .2s, box-shadow linear .2s;height:30px;}
|
||||
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__rendered {line-height: 30px;}
|
||||
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__arrow {height:30px;}
|
||||
.tabcon1711 .select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.tabcon1711 .select2-results__option[aria-selected] {font-size:12px;}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">资源申请编辑</h3>
|
||||
<p class="description_text"></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- 标签页导航 -->
|
||||
<div class="tab-wrap">
|
||||
|
||||
<div class="tab-content tabcon1711">
|
||||
<!-- 表单 -->
|
||||
<form id="form" action="{:U('apply_edit?id='.$data['id'])}" method="post" class="form-horizontal">
|
||||
<!-- 基础文档模型 -->
|
||||
<div id="tab1" class="tab-pane in tab1">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>游戏名称:</td>
|
||||
<td class="r" >
|
||||
<input type="text" class="txt " name="game_name" value="{$data['game_name']}" placeholder="请输入游戏名称" readonly="true">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">游戏区服:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt " name="server_name" value="{$data['server_name']}" placeholder="请输入区服" readonly="true">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">账号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt " name="user_account" value="{$data['user_account']}" placeholder="请输入游戏账号" readonly="true">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">密码:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt " name="user_password" value="{:base64_decode($data['user_password'])}" placeholder="请输入游戏密码">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">角色名称:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt " name="role_name" value="{$data['role_name']}" placeholder="请输入角色名称">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{$data['id']}">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="form-item cf">
|
||||
<button class="submit_btn ajax-post " id="submit" type="submit" target-form="form-horizontal" style="margin-left:210px;">
|
||||
保存
|
||||
</button>
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Giftbag/lists">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
$('.side-sub-menu').eq(0).show();
|
||||
highlight_subnav('{:U('TestResource/index')}');
|
||||
$('#submit').click(function(){
|
||||
$('#form').submit();
|
||||
});
|
||||
if($("#game_id").val()){
|
||||
fun_ajax($("#game_id").val());
|
||||
}
|
||||
$(function(){
|
||||
showTab();
|
||||
$("#game_name").val($("#game_id option:selected").text());
|
||||
|
||||
$('.date').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
language:"zh-CN",
|
||||
minView:2,
|
||||
autoclose:true
|
||||
});
|
||||
$('.time').datetimepicker({
|
||||
language:"zh-CN",
|
||||
hour: 13,
|
||||
minute: 15
|
||||
});
|
||||
showTab();
|
||||
//Initialize();
|
||||
$("#game_id").select2();
|
||||
});
|
||||
|
||||
/*获取区服名称*/
|
||||
$("#server_id").change(function() {
|
||||
$("#server_name").val($("#server_id option:selected").text());
|
||||
});
|
||||
/*获取游戏名称*/
|
||||
var trid = $('.js-typeradio:checked').siblings('input').css({'display':'none'}).attr('id');
|
||||
$('.'+trid).hide();
|
||||
var ratio_type=$("input[type=radio]:checked").val();
|
||||
if(ratio_type == 1){
|
||||
var file_type="apk";
|
||||
}else if(ratio_type == 2){
|
||||
var file_type="ipa";
|
||||
}
|
||||
$("#game_id").change(function(){
|
||||
$(".inp_radio").click();
|
||||
});
|
||||
$(".inp_radio").click(function(){
|
||||
if($("#game_id option:selected").val()==0){
|
||||
alert('请选择游戏');
|
||||
return false;
|
||||
}
|
||||
var ratio_type=$("#game_id").children('option:selected').attr('sdk_version');
|
||||
if(ratio_type == 1){
|
||||
var file_type="apk";
|
||||
}else if(ratio_type == 2){
|
||||
var file_type="ipa";
|
||||
}
|
||||
var str = location.href,game_id=$("#game_id option:selected").val();
|
||||
str = str.replace('.html','');
|
||||
str = str+'/game_id/'+game_id+'/ratio_type/'+ratio_type;
|
||||
window.location.href=str;
|
||||
});
|
||||
|
||||
function Initialize(){
|
||||
$server_name = "{:get_area_name($data['server_id'])}";
|
||||
$("#server_id").html("<option value='{$data.server_id}'>"+$server_name+"</option>");
|
||||
$("#server_name").val($("#server_id option:selected").text());
|
||||
}
|
||||
/*获取游戏名称*/
|
||||
$("#game_id").change(function(){
|
||||
var ratio_type=$("#game_id").children('option:selected').attr('sdk_version');
|
||||
$("#game_name").val($("#game_id option:selected").text());
|
||||
$("input[name='server_version']").val('ratio_type');
|
||||
if(ratio_type==2){
|
||||
$(".server_version_name").html('<input type="radio" class="inp_radio" checked value="2" name="giftbag_version" > 苹果');
|
||||
}else{
|
||||
$(".server_version_name").html('<input type="radio" class="inp_radio" checked value="1" name="giftbag_version" > 安卓');
|
||||
}
|
||||
fun_ajax($("#game_id option:selected").val());
|
||||
});
|
||||
|
||||
function fun_ajax(gid){
|
||||
var url = "{:U('Giftbag/get_ajax_area_list')}";
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:url,
|
||||
dataType:"json",
|
||||
data:{game_id:gid},
|
||||
success:function(data){
|
||||
fun_html(data);
|
||||
$("#server_name").val($("#server_id option:selected").text());
|
||||
},
|
||||
error:function(){
|
||||
layer.msg('服务器异常',{icon:5});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function fun_html(data){
|
||||
var area='';
|
||||
if(data == null){
|
||||
$("#server_id").html('<option value="">请选择区服</option>');
|
||||
}else{
|
||||
area+="<option value=''>请选择区服</option>";
|
||||
for (var i = 0; i<data.length; i++){
|
||||
area+='<option value="'+data[i]['id']+'">'+data[i]['server_name']+'</option>';
|
||||
}
|
||||
$("#server_id").html(area);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,451 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<div class="fr">
|
||||
<a <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if> href="{:U('index',array('type'=>1))}">测试资源申请</a>
|
||||
</div>
|
||||
<h3 class="page_title">测试资源申请</h3>
|
||||
<if condition="(I('type',1) eq 1) ">
|
||||
<p class="description_text">说明:此功能是测试资源申请的功能</p>
|
||||
<else/>
|
||||
<p class="description_text">说明:此功是查看并管理混服申请的功能</p>
|
||||
</if>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list" style="margin-bottom:15px">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
|
||||
<option value="">游戏名称</option>
|
||||
<volist name=":get_game_list()" id="vo">
|
||||
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-server search_label_rehab">
|
||||
<select id="server_id" name="server_name" class="select_gallery" style="width:120px;">
|
||||
<option value="">区服名称</option>
|
||||
<if condition="$_GET['server_name'] neq ''"><option value="{$_GET['server_name']}">{$_GET['server_name']}</option></if>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="user_account" placeholder="测试账号" class="" value="{:I('user_account')}"/>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="role_name" placeholder="角色名称" class="" value="{:I('role_name')}"/>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
<input type="text" id="time-start" name="start" class="" value="{:I('start')}" placeholder="注册开始时间" />
|
||||
-
|
||||
<div class="input-append date" id="datetimepicker" style="display:inline-block">
|
||||
<input type="text" id="time-end" name="end" class="" value="{:I('end')}" placeholder="注册结束时间" />
|
||||
<span class="add-on"><i class="icon-th"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</empty>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestResource/index','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl button_list" style="width:100%;">
|
||||
<div class="tools">
|
||||
<empty name="show_status">
|
||||
<a class="fr" id="batch_add"><span class="button_icon button_icon9"></span>批量申请后续</a>
|
||||
<a class="fr" href="{:U('add?model='.$model['id'])}"><span class="button_icon button_icon1"></span>新增测试账号</a>
|
||||
</empty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input class="check-all" type="checkbox">
|
||||
</th>
|
||||
<th>产品名称</th>
|
||||
<th>区服</th>
|
||||
<th>测试账号</th>
|
||||
<th>所属推广员</th>
|
||||
<th>角色名称</th>
|
||||
<th>累计发放资源</th>
|
||||
<th>累计发放次数</th>
|
||||
<th>申请数量</th>
|
||||
<th>状态</th>
|
||||
<th ><a class="paixu" data-order='create_time'>注册时间</a></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "data">
|
||||
<volist name="data" id="data">
|
||||
<tr>
|
||||
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
|
||||
<td>{$data.game_name}</td>
|
||||
<td>{$data.server_name}</td>
|
||||
<td>{$data.user_account}</td>
|
||||
<td>{$data.promote_account}</td>
|
||||
<td>{$data.role_name}</td>
|
||||
<td>{$data.verify_resource_count}</td>
|
||||
<td>{$data.verify_count}</td>
|
||||
<td>{$data.apply_resource_count}</td>
|
||||
<td>
|
||||
<if condition="$data['check_status'] eq 1">
|
||||
正常
|
||||
<else />
|
||||
冻结
|
||||
</if>
|
||||
</td>
|
||||
<td>{$data.create_time}</td>
|
||||
<td>
|
||||
<a href="{:U('edit',array('id'=>$data['id']))}" class="">编辑</a>
|
||||
<a href="{:U('apply',array('id'=>$data['id']))}" class="">申请</a>
|
||||
</td>
|
||||
</tr>
|
||||
</volist>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$('.side-sub-menu').eq(0).show();
|
||||
$(".select_gallery").select2();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('testResource/index')}');
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
$(".paixu").click(function(){
|
||||
var that=$(this);
|
||||
$data_order=that.attr('data-order');
|
||||
$order_type='{$userarpu_order}';
|
||||
if($order_type==''||$order_type=='4'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='3,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}else if($order_type=='3'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='4,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
$("#admin").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$(this).find('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#admin #i_list_id').on('keyup',function(event) {
|
||||
var val = $.trim($(this).val()).toLowerCase();
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(val);
|
||||
});
|
||||
|
||||
$("#admin #i_list_li").find("a").each(function(){
|
||||
$(this).click(function(){
|
||||
var text = $.trim($(this).text()).toLowerCase();
|
||||
$(this).closest('.drop-down').find("#i_list_id").val(text);
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(text);
|
||||
})
|
||||
});
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*渠道删除*/
|
||||
$('.delete').click(function(){
|
||||
var id = $(this).attr('data-id');
|
||||
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
|
||||
title:'确定要删除该渠道?',
|
||||
icon:0,
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('del_promote')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
}
|
||||
}
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
alert('请求失败');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$("#game_id").change(function(){
|
||||
$.ajax({
|
||||
url:"{:U('Ajax/getServer')}",
|
||||
type:"post",
|
||||
data:{game_id:$("#game_id option:selected").attr('game-id')},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
str = "<option value=''>请选择区服</option>";
|
||||
for (var i in data){
|
||||
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
|
||||
}
|
||||
$("#server_id").empty();
|
||||
$("#server_id").append(str);
|
||||
$("#server_id").select2();
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#batch_add').click(function () {
|
||||
var ids = $('.ids:checked');
|
||||
|
||||
if (ids.length > 0) {
|
||||
var str = new Array();
|
||||
ids.each(function () {
|
||||
str.push($(this).val());
|
||||
});
|
||||
param = str.join(',');
|
||||
} else {
|
||||
layer.msg('请选择要操作的数据');
|
||||
return false;
|
||||
}
|
||||
var url = "{:U('apply','','')}" + '/id/' + param;
|
||||
window.location.href = url;
|
||||
|
||||
});
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,411 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
.butnbox {padding:10px 0 20px;}
|
||||
.butnbox .butnlist {overflow:hidden;clear:both;}
|
||||
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
|
||||
.butnbox .butnlist .butn {display:inline-block;width:120px;height:38px;line-height:38px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
|
||||
.butnbox .butnlist .butn.last {background:#009900;}
|
||||
.butnbox .butnlist .butn~.butn {margin-left:20px;}
|
||||
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<div class="fr">
|
||||
<a <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if> href="{:U('protectLogList',array('type'=>1))}">日志管理</a>
|
||||
</div>
|
||||
<h3 class="page_title">测试资源申请</h3>
|
||||
<if condition="(I('type',1) eq 1) ">
|
||||
<p class="description_text">说明:此功能是测试资源申请的功能</p>
|
||||
<else/>
|
||||
<p class="description_text">说明:此功是查看并管理混服申请的功能</p>
|
||||
</if>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list" style="margin-bottom:15px">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
|
||||
<option value="">游戏名称</option>
|
||||
<volist name=":get_game_list()" id="vo">
|
||||
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-server search_label_rehab">
|
||||
<select id="server_id" name="server_name" class="select_gallery" style="width:120px;">
|
||||
<option value="">区服名称</option>
|
||||
<if condition="$_GET['server_name'] neq ''"><option value="{$_GET['server_name']}">{$_GET['server_name']}</option></if>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="role_name" placeholder="角色名" class="" value="{:I('role_name')}"/>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="user_account" placeholder="测试账号" class="" value="{:I('user_account')}"/>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
<input type="text" id="time-start" name="start" class="" value="{:I('start')}" placeholder="注册开始时间" />
|
||||
-
|
||||
<div class="input-append date" id="datetimepicker" style="display:inline-block">
|
||||
<input type="text" id="time-end" name="end" class="" value="{:I('end')}" placeholder="注册结束时间" />
|
||||
<span class="add-on"><i class="icon-th"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group normal_space fl">
|
||||
<label class="form-title select-title">异常类型:</label>
|
||||
<select id="types" name="types" class="select_gallery" >
|
||||
<option game-id="0" value="">请选择异常类型</option>
|
||||
<option value="1" <if condition="$_REQUEST['types'] eq 1">selected="selected"</if>>登陆ip异常</option>
|
||||
<option value="2" <if condition="$_REQUEST['types'] eq 2">selected="selected"</if>>设备信息异常</option>
|
||||
</select>
|
||||
</div>
|
||||
</empty>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestResource/protectLogList','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<th>区服</th>
|
||||
<th>测试账号</th>
|
||||
<th>所属推广员</th>
|
||||
<th>角色名称</th>
|
||||
<th>异常内容</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "data">
|
||||
<volist name="data" id="s">
|
||||
<tr>
|
||||
<td>{$s.game_name}</td>
|
||||
<td>{$s.server_name}</td>
|
||||
<td>{$s.user_account}</td>
|
||||
<td>{$s.promote_account}</td>
|
||||
<td>{$s.nickname}</td>
|
||||
<td>{$s.detail}</td>
|
||||
</tr>
|
||||
</volist>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$('.side-sub-menu').eq(0).show();
|
||||
$(".select_gallery").select2();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('testResource/protectLogList')}');
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
$(".paixu").click(function(){
|
||||
var that=$(this);
|
||||
$data_order=that.attr('data-order');
|
||||
$order_type='{$userarpu_order}';
|
||||
if($order_type==''||$order_type=='4'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='3,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}else if($order_type=='3'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='4,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*渠道删除*/
|
||||
$('.delete').click(function(){
|
||||
var id = $(this).attr('data-id');
|
||||
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
|
||||
title:'确定要删除该渠道?',
|
||||
icon:0,
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('del_promote')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
}
|
||||
}
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
alert('请求失败');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$("#game_id").change(function(){
|
||||
$.ajax({
|
||||
url:"{:U('Ajax/getServer')}",
|
||||
type:"post",
|
||||
data:{game_id:$("#game_id option:selected").attr('game-id')},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
str = "<option value=''>请选择区服</option>";
|
||||
for (var i in data){
|
||||
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
|
||||
}
|
||||
$("#server_id").empty();
|
||||
$("#server_id").append(str);
|
||||
$("#server_id").select2();
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#batch_add').click(function () {
|
||||
var ids = $('.ids:checked');
|
||||
|
||||
if (ids.length > 0) {
|
||||
var str = new Array();
|
||||
ids.each(function () {
|
||||
str.push($(this).val());
|
||||
});
|
||||
param = str.join(',');
|
||||
} else {
|
||||
layer.msg('请选择要操作的数据');
|
||||
return false;
|
||||
}
|
||||
var url = "{:U('apply','','')}" + '/id/' + param;
|
||||
window.location.href = url;
|
||||
|
||||
});
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,483 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<div class="fr">
|
||||
<a <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if> href="{:U('supportNumberList',array('type'=>1))}">扶持号管理</a>
|
||||
</div>
|
||||
<h3 class="page_title">测试资源申请</h3>
|
||||
<if condition="(I('type',1) eq 1) ">
|
||||
<p class="description_text">说明:此功能是测试资源申请的功能</p>
|
||||
<else/>
|
||||
<p class="description_text">说明:此功是查看并管理混服申请的功能</p>
|
||||
</if>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list" style="margin-bottom:15px">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
|
||||
<option value="">游戏名称</option>
|
||||
<volist name=":get_game_list()" id="vo">
|
||||
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-server search_label_rehab">
|
||||
<select id="server_id" name="server_name" class="select_gallery" style="width:120px;">
|
||||
<option value="">区服名称</option>
|
||||
<if condition="$_GET['server_name'] neq ''"><option value="{$_GET['server_name']}">{$_GET['server_name']}</option></if>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="role_name" placeholder="角色名称" class="" value="{:I('role_name')}"/>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="user_account" placeholder="测试账号" class="" value="{:I('user_account')}"/>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
|
||||
<input type="text" name="promote_name" placeholder="所属推广员" class="" value="{:I('promote_name')}"/>
|
||||
</div>
|
||||
</empty>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestResource/supportNumberList','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<th>区服</th>
|
||||
<th>测试账号</th>
|
||||
<th>所属推广员</th>
|
||||
<th>角色名称</th>
|
||||
<th>设备信息</th>
|
||||
<th>状态</th>
|
||||
<th >创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "data">
|
||||
<volist name="data" id="s">
|
||||
<tr data-id="{$s.user_id}">
|
||||
<td>{$s.game_name}</td>
|
||||
<td>{$s.server_name}</td>
|
||||
<td>{$s.user_account}</td>
|
||||
<td>{$s.promote_account}</td>
|
||||
<td>{$s.role_name}</td>
|
||||
<td>
|
||||
<if condition="$s['device_number'] eq ''">尚未登录,无设备号
|
||||
<else/>{$s.device_number}
|
||||
</if>
|
||||
</td>
|
||||
<td>
|
||||
<if condition="$s['check_status'] eq 0">冻结
|
||||
<else/>启用
|
||||
</if>
|
||||
</td>
|
||||
<td>{$s.create_time}</td>
|
||||
<td>
|
||||
<if condition="$s['check_status'] eq 1">
|
||||
<a href="javascript:;" class="froze-btn editbtn">冻结</a>
|
||||
|
||||
<else/>
|
||||
<a href="javascript:;" class="unfroze-btn editbtn">启用</a>
|
||||
<!-- <a class="confirm ajax-get" href="{:U('TestResource/unfreezeSupport?id='.$s['id'])}">启用</a>-->
|
||||
</if>
|
||||
<a href="javascript:;" data-id="{$s.user_id}" class="changePassward-btn editbtn">重置密码</a>
|
||||
</td>
|
||||
</tr>
|
||||
</volist>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$('.side-sub-menu').eq(0).show();
|
||||
$(".select_gallery").select2();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('testResource/supportNumberList')}');
|
||||
$(function(){
|
||||
|
||||
$('.froze-btn').on({
|
||||
click: function() {
|
||||
var id = $(this).parents('tr').eq(0).attr('data-id')
|
||||
layer.confirm('是否确认冻结帐号?', {icon: 3, title:'提示'}, function(index){
|
||||
$.ajax({
|
||||
url: "{:U('TestResource/freezeSupport')}",
|
||||
data: {support_id: id},
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
layer.msg(response.msg, {time: 1000}, function() {
|
||||
window.location.href = window.location.href
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
$('.unfroze-btn').on({
|
||||
click: function() {
|
||||
var id = $(this).parents('tr').eq(0).attr('data-id')
|
||||
layer.confirm('是否确认启用帐号?', {icon: 3, title:'提示'}, function(index){
|
||||
$.ajax({
|
||||
url: "{:U('TestResource/unfreezeSupport')}",
|
||||
data: {support_id: id},
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
layer.msg(response.msg, {time: 1000}, function() {
|
||||
window.location.href = window.location.href
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
$('.changePassward-btn').on({
|
||||
click: function() {
|
||||
var id = $(this).attr('data-id')
|
||||
console.log(id);
|
||||
layer.confirm('是否确认重置账号密码?', {icon: 3, title:'提示'}, function(index){
|
||||
$.ajax({
|
||||
url: "{:U('TestResource/rechangePassward')}",
|
||||
data: {support_id: id},
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
console.log(response)
|
||||
layer.confirm(response.msg, {icon: 3, title:'提示'}, function() {
|
||||
window.location.href = window.location.href
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
$("#admin").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$(this).find('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#admin #i_list_id').on('keyup',function(event) {
|
||||
var val = $.trim($(this).val()).toLowerCase();
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(val);
|
||||
});
|
||||
|
||||
$("#admin #i_list_li").find("a").each(function(){
|
||||
$(this).click(function(){
|
||||
var text = $.trim($(this).text()).toLowerCase();
|
||||
$(this).closest('.drop-down').find("#i_list_id").val(text);
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(text);
|
||||
})
|
||||
});
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*渠道删除*/
|
||||
$('.delete').click(function(){
|
||||
var id = $(this).attr('data-id');
|
||||
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
|
||||
title:'确定要删除该渠道?',
|
||||
icon:0,
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('del_promote')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
}
|
||||
}
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
alert('请求失败');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$("#game_id").change(function(){
|
||||
$.ajax({
|
||||
url:"{:U('Ajax/getServer')}",
|
||||
type:"post",
|
||||
data:{game_id:$("#game_id option:selected").attr('game-id')},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
str = "<option value=''>请选择区服</option>";
|
||||
for (var i in data){
|
||||
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
|
||||
}
|
||||
$("#server_id").empty();
|
||||
$("#server_id").append(str);
|
||||
$("#server_id").select2();
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#batch_add').click(function () {
|
||||
var ids = $('.ids:checked');
|
||||
|
||||
if (ids.length > 0) {
|
||||
var str = new Array();
|
||||
ids.each(function () {
|
||||
str.push($(this).val());
|
||||
});
|
||||
param = str.join(',');
|
||||
} else {
|
||||
layer.msg('请选择要操作的数据');
|
||||
return false;
|
||||
}
|
||||
var url = "{:U('apply','','')}" + '/id/' + param;
|
||||
window.location.href = url;
|
||||
|
||||
});
|
||||
</script>
|
||||
</block>
|
Loading…
Reference in New Issue