diff --git a/Application/Admin/Controller/GiftbagController.class.php b/Application/Admin/Controller/GiftbagController.class.php index 7e01d8f41..f1b4a4dd2 100644 --- a/Application/Admin/Controller/GiftbagController.class.php +++ b/Application/Admin/Controller/GiftbagController.class.php @@ -102,6 +102,20 @@ class GiftbagController extends ThinkController { public function add(){ if(IS_POST){ + + + + if ($_POST['giftbag_version'] == '3') { + $whereGift['giftbag_version'] = $_POST['giftbag_version']; + $whereGift['game_id'] = $_POST['game_id']; + $_POST['start_time'] = time(); + $giftData = D('giftbag')->field('id')->where($whereGift)->find(); + + if ($giftData) { + $this->error('超级签礼包一个游戏只能有一个!'); + } + } + $Model = D('Giftbag'); // 获取模型的字段信息 $Model = $this->checkAttr($Model,$model['id']); @@ -114,6 +128,10 @@ class GiftbagController extends ThinkController { } } $data = $Model->create(); + if ($_POST['giftbag_version'] == '3') { + $data['start_time'] = time(); + } +// var_dump($data);die(); if($data){ $data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']); $data['server_name']=get_server_name($data['server_id']); diff --git a/Application/Admin/Controller/TestResourceController.class.php b/Application/Admin/Controller/TestResourceController.class.php new file mode 100644 index 000000000..bfe155bea --- /dev/null +++ b/Application/Admin/Controller/TestResourceController.class.php @@ -0,0 +1,627 @@ +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(); + } + + +} \ No newline at end of file diff --git a/Application/Admin/Model/ProtectLogModel.class.php b/Application/Admin/Model/ProtectLogModel.class.php new file mode 100644 index 000000000..5ae18d9e6 --- /dev/null +++ b/Application/Admin/Model/ProtectLogModel.class.php @@ -0,0 +1,71 @@ + +// +---------------------------------------------------------------------- + +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; + } + + +} diff --git a/Application/Admin/Model/TestResourceModel.class.php b/Application/Admin/Model/TestResourceModel.class.php new file mode 100644 index 000000000..5b601848b --- /dev/null +++ b/Application/Admin/Model/TestResourceModel.class.php @@ -0,0 +1,80 @@ + +// +---------------------------------------------------------------------- + +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); + } + + + +} diff --git a/Application/Admin/View/Giftbag/add.html b/Application/Admin/View/Giftbag/add.html index 790402671..a1ce0fc1c 100644 --- a/Application/Admin/View/Giftbag/add.html +++ b/Application/Admin/View/Giftbag/add.html @@ -58,7 +58,7 @@
- + - + - + - + - + - + - + - + - + - +
*游戏名称:
运营平台 + + + - + + + +
礼包状态: @@ -97,7 +107,7 @@
礼包类型: @@ -115,13 +125,13 @@
*礼包名称:
礼包区服:
开始周期:
激活码:
使用说明:
礼包内容: @@ -199,7 +209,15 @@ $('#submit').click(function(){ if($("#game_id").val()){ fun_ajax($("#game_id").val()); } + $(function(){ + $("#gift_platform").change(function() { + var radio = $("#gift_platform input[type='radio']:checked").val(); + $('#giftbag_version').val(radio); + }); + $(".inp_radio").change(function () { + changePage(); + }); $("#game_name").val($("#game_id option:selected").text()); $('.date').datetimepicker({ format: 'yyyy-mm-dd', @@ -226,8 +244,9 @@ $("#game_id").change(function(){ $("#game_name").val($("#game_id option:selected").text()); var ratio_type=$("#game_id").children('option:selected').attr('sdk_version'); $("input[type='radio'][name='giftbag_version'][value='"+ratio_type+"']").prop("checked",true); - $('#giftbag_version').val(ratio_type); + // $('#giftbag_version').val(ratio_type); fun_ajax($("#game_id option:selected").val()); + changePage(); }); function fun_ajax(gid){ @@ -258,5 +277,36 @@ function fun_html(data){ $("#server_id").html(area); } } +function changePage() { + console.log($(".inp_radio:checked").val()) + var type = $(".inp_radio:checked").val(); + if (type == 3) { + var ratio_type=$("#game_id").children('option:selected').attr('sdk_version'); + if (ratio_type == 1) { + $("input[type='radio'][name='giftbag_version'][value='"+ratio_type+"']").prop("checked",true); + updateAlert('超级签只能是苹果运营平台!'); + setTimeout(function() { + $("#tip").removeClass('block tip_right'); + },1500); + } else { + $("#gift_status").hide(); + $($("#gift_status input[type='radio']").eq(1)).prop('checked',true); + $("#gift_type").hide(); + $($("#gift_type input[type='radio']").eq(1)).prop('checked',true); + $("#gift_server").hide(); + $("#server_id").val(""); + $("#gift_time").hide(); + $("input[name='start_time']").val(""); + $("input[name='end_time']").val(""); + } + + } else { + $("#gift_status").show(); + + $("#gift_type").show(); + $("#gift_server").show(); + $("#gift_time").show(); + } +} \ No newline at end of file diff --git a/Application/Admin/View/TestResource/add.html b/Application/Admin/View/TestResource/add.html new file mode 100644 index 000000000..2e8c30fc9 --- /dev/null +++ b/Application/Admin/View/TestResource/add.html @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + + + +
+ +
+
+ +
+
+ +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
测试账号密码角色名称资源数量备注操作
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除 + 新增 +
+ +
+ +
+ +
+ +
+
+ +
+ + + +
+ + + + + + diff --git a/Application/Admin/View/TestResource/apply.html b/Application/Admin/View/TestResource/apply.html new file mode 100644 index 000000000..f6988eeaa --- /dev/null +++ b/Application/Admin/View/TestResource/apply.html @@ -0,0 +1,226 @@ + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + +
扶持数量: + +
备注: + +
+
+ + + +
+ + + 返回 + +
+
+
+
+ + + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + + diff --git a/Application/Admin/View/TestResource/edit.html b/Application/Admin/View/TestResource/edit.html new file mode 100644 index 000000000..e45b88d2e --- /dev/null +++ b/Application/Admin/View/TestResource/edit.html @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
*游戏名称: + +
游戏区服: + +
账号: + +
密码: + +
角色名称: + +
+
+ + + +
+ + + 返回 + +
+
+
+
+ + + +
+ + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + + diff --git a/Application/Admin/View/TestResource/index.html b/Application/Admin/View/TestResource/index.html new file mode 100644 index 000000000..d6722b23a --- /dev/null +++ b/Application/Admin/View/TestResource/index.html @@ -0,0 +1,451 @@ + + + + + + + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +   +
+
+ +   +
+
+ + - +
+ + +
+
+ + + +
+ 搜索 +
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 产品名称区服测试账号所属推广员角色名称累计发放资源累计发放次数申请数量状态注册时间操作
aOh! 暂时还没有内容!
{$data.game_name}{$data.server_name}{$data.user_account}{$data.promote_account}{$data.role_name}{$data.verify_resource_count}{$data.verify_count}{$data.apply_resource_count} + + 正常 + + 冻结 + + {$data.create_time} + 编辑 + 申请 +
+
+ +
+ +
+
+ {$_page|default=''} +
+ + + +
+ + + + + + diff --git a/Application/Admin/View/TestResource/lists.html b/Application/Admin/View/TestResource/lists.html new file mode 100644 index 000000000..fd03b4c41 --- /dev/null +++ b/Application/Admin/View/TestResource/lists.html @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + +
+ + + + +
+
+ +
+
+ +
+
+ +
+
+ +   +
+
+ +   +
+
+ + - +
+ + +
+
+ + + +
+ 搜索 +
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
游戏名称区服测试账号手机号角色名称申请数量实际发放备注审核状态审核意见申请人申请时间审核时间
aOh! 暂时还没有内容!
{$s.game_name}{$s.server_name}{$s.user_account}{$s.phone}{$s.role_name}{$s.apply_resource}{$s.verify_resource}{$s.apply_remark} + 审核未通过 + 审核通过 + 待审核 + + {$s.verify_remark}{$s.promote_account}{:date('Y-m-d H:i:s',$s['create_time'])}{:empty($s['verify_time'])?'':date('Y-m-d H:i:s',$s['verify_time'])}尚未审核
+
+ +
+ +
+
+ {$_page|default=''} +
+ + + +
+ + + + + + diff --git a/Application/Admin/View/TestResource/protectLogList.html b/Application/Admin/View/TestResource/protectLogList.html new file mode 100644 index 000000000..ecae288ac --- /dev/null +++ b/Application/Admin/View/TestResource/protectLogList.html @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +   +
+
+ +   +
+
+ + - +
+ + +
+
+
+ + +
+ + + +
+ 搜索 +
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
产品名称区服测试账号所属推广员角色名称异常内容
aOh! 暂时还没有内容!
{$s.game_name}{$s.server_name}{$s.user_account}{$s.promote_account}{$s.nickname}{$s.detail}
+
+ +
+ +
+
+ {$_page|default=''} +
+ + + +
+ + + + + + diff --git a/Application/Admin/View/TestResource/supportNumberList.html b/Application/Admin/View/TestResource/supportNumberList.html new file mode 100644 index 000000000..1e3f0ecd0 --- /dev/null +++ b/Application/Admin/View/TestResource/supportNumberList.html @@ -0,0 +1,483 @@ + + + + + + + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +   +
+
+ +   +
+
+ +   +
+ + + +
+ 搜索 +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
产品名称区服测试账号所属推广员角色名称设备信息状态创建时间操作
aOh! 暂时还没有内容!
{$s.game_name}{$s.server_name}{$s.user_account}{$s.promote_account}{$s.role_name} + 尚未登录,无设备号 + {$s.device_number} + + + 冻结 + 启用 + + {$s.create_time} + + 冻结 + + + 启用 + + + 重置密码 +
+
+ +
+ +
+
+ {$_page|default=''} +
+ + + +
+ + + + + + diff --git a/Application/Base/Repository/SpendRepository.class.php b/Application/Base/Repository/SpendRepository.class.php index 4d0d889ff..c7409113e 100644 --- a/Application/Base/Repository/SpendRepository.class.php +++ b/Application/Base/Repository/SpendRepository.class.php @@ -8,112 +8,131 @@ class SpendRepository { } - private function assembleDayRecords($items, $dayList, $valueColumn, $dayColumn = 'day') + private function assembleRecords($items, $keys, $valueColumn, $keyColumn = 'day') { $records = []; - foreach ($dayList as $day) { - $dayValue = 0; + foreach ($keys as $key) { + $value = 0; foreach ($items as $item) { - if ($item[$dayColumn] == $day) { - $dayValue = $item[$valueColumn]; + if ($item[$keyColumn] == $key) { + $value = $item[$valueColumn]; } } - $records[$day] = $dayValue; + $records[$key] = $value; } return $records; } - /** - * 付费游戏数 - */ - public function getPayGameCountByDay($params) { + private function getGameGroupConditions($params) + { + $beginTime = $params['begin_time'] ?? 0; + $endTime = $params['end_time'] ?? 0; + $ids = $params['promote_ids'] ?? []; + $isBan = $params['is_ban'] ?? false; + $gameIds = $params['game_ids'] ?? []; + + $conditions = []; + $conditions['pay_status'] = 1; + $conditions['promote_id'] = ['in', $ids]; + $conditions['pay_time'] = ['between', [$beginTime, $endTime]]; + $conditions['game_id'] = ['in', $gameIds]; + $conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + return $conditions; + } + + private function getDayGroupConditions($params) + { $beginTime = $params['begin_time'] ?? 0; $endTime = $params['end_time'] ?? 0; $gameId = $params['game_id'] ?? 0; $serverId = $params['server_id'] ?? 0; $ids = $params['promote_id'] ?? []; $isBan = $params['is_ban'] ?? false; - $dayList = $params['dayList'] ?? []; - $map = []; - $map['pay_status'] = 1; - $map['promote_id'] = ['in', $ids]; - $map['pay_time'] = ['between', [$beginTime, $endTime]]; - $map['game_id'] = $gameId > 0 ? $gameId : ['gt', 0]; - $map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + $conditions = []; + $conditions['pay_status'] = 1; + $conditions['promote_id'] = ['in', $ids]; + $conditions['pay_time'] = ['between', [$beginTime, $endTime]]; + $conditions['game_id'] = $gameId > 0 ? $gameId : ['gt', 0]; + $conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; - $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(DISTINCT game_id) count'; - $items = M('spend', 'tab_')->field($field)->where($map)->group('day')->select(); - return $this->assembleDayRecords($items, $dayList, 'count'); + return $conditions; } /** - * 按天统计付款总额 + * 付费游戏数 */ - public function getPayAmountByDay($params) { - $beginTime = $params['begin_time'] ?? 0; - $endTime = $params['end_time'] ?? 0; - $gameId = $params['game_id'] ?? 0; - $serverId = $params['server_id'] ?? 0; - $ids = $params['promote_id'] ?? []; - $isBan = $params['is_ban'] ?? false; + public function getPayGameCountGroupByDay($params) + { $dayList = $params['dayList'] ?? []; + $conditions = $this->getDayGroupConditions($params); + $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(DISTINCT game_id) count'; + $items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select(); + return $this->assembleRecords($items, $dayList, 'count'); + } - $map['pay_status'] = 1; - $map['pay_time'] = ['between', [$beginTime, $endTime]]; - $map['game_id'] = $gameId > 0 ? $gameId : ['gt', 0]; - $map['promote_id'] = ['in', $ids]; - $map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + /** + * 付费游戏数 + */ + public function getPayGameCountGroupByGame($params) + { + $gameIds = $params['game_ids'] ?? []; + $conditions = $this->getGameGroupConditions($params); + $field = 'game_id, count(*) count'; + $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); + return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); + } + /** + * 按天统计付款总额 + */ + public function getPayAmountGroupByDay($params) { + $dayList = $params['dayList'] ?? []; + $conditions = $this->getDayGroupConditions($params); $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, sum(pay_amount) as amount'; - $items = M('spend', 'tab_')->field($field)->where($map)->group('day')->select(); - return $this->assembleDayRecords($items, $dayList, 'amount'); + $items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select(); + return $this->assembleRecords($items, $dayList, 'amount'); + } + + /** + * 按游戏统计付款总额 + */ + public function getPayAmountGroupByGame($params) { + $gameIds = $params['game_ids'] ?? []; + $conditions = $this->getGameGroupConditions($params); + $field = 'game_id, sum(pay_amount) as amount'; + $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); + return $this->assembleRecords($items, $gameIds, 'amount', 'game_id'); } /** * 按天统计付款用户数 */ - public function getPayUserCountByDay($params) { - $beginTime = $params['begin_time'] ?? 0; - $endTime = $params['end_time'] ?? 0; - $gameId = $params['game_id'] ?? 0; - $serverId = $params['server_id'] ?? 0; - $ids = $params['promote_id'] ?? []; - $isBan = $params['is_ban'] ?? false; + public function getPayUserCountGroupByDay($params) { $dayList = $params['dayList'] ?? []; - - $map['pay_status'] = 1; - $map['pay_time'] = ['between', [$beginTime, $endTime]]; - $map['game_id'] = $gameId > 0 ? $gameId : ['gt', 0]; - $map['promote_id'] = ['in', $ids]; - $map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; - + $conditions = $this->getDayGroupConditions($params); $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(distinct user_id) count'; + $items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select(); + return $this->assembleRecords($items, $dayList, 'count'); + } - $items = M('spend', 'tab_')->field($field)->where($map)->group('day')->select(); - return $this->assembleDayRecords($items, $dayList, 'count'); + /** + * 游戏统计付款用户数 + */ + public function getPayUserCountGroupByGame($params) { + $gameIds = $params['game_ids'] ?? []; + $conditions = $this->getGameGroupConditions($params); + $field = 'game_id, count(distinct user_id) count'; + $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); + return $this->assembleRecords($items, $dayList, 'count', 'game_id'); } /** * 按照时间分组统计新增付费用户数 */ - public function getNewPayUserCountByDay($params) { + public function getNewPayUserCountGroupByDay($params) { $dayList = $params['dayList'] ?? []; - $gameId = $params['game_id'] ?? 0; - $serverId = $params['server_id'] ?? 0; - $ids = $params['promote_id'] ?? []; - $isBan = $params['is_ban'] ?? false; - - $map = []; - $map['pay_status']=1; - if ($gameId > 0) { - $map['game_id'] = $gameId; - } - if ($serverId > 0) { - $map['server_id'] = $serverId; - } - $map['promote_id'] = ['in', $ids]; - $map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + $conditions = $this->getDayGroupConditions($params); $oldMap = $map; $records = []; @@ -129,26 +148,27 @@ class SpendRepository { return $records; } + /** + * 按照时间分组统计新增付费用户数 + */ + public function getNewPayUserCountGroupByGame($params) { + $beginTime = $params['begin_time'] ?? 0; + $gameIds = $params['game_ids'] ?? []; + $conditions = $this->getGameGroupConditions($params); + $oldConditions = $conditions; + $oldConditions['pay_time'] = ['lt', $beginTime]; + $oldQuery = M('spend', 'tab_')->field('user_id')->where($oldConditions)->group('user_id')->buildSql(); + $map['user_id'] = ['exp', ' not in (' . $oldQuery . ')']; + $items = M('spend', 'tab_')->field('count(distinct user_id) count, game_id')->where($conditions)->group('game_id')->find(); + return $this->assembleRecords($items, $gameIds, 'amount', 'game_id'); + } + /** * 按照时间分组统计新增付费用户付费金额 */ - public function getNewPayAmountByDay($params) { + public function getNewPayAmountGroupByDay($params) { $dayList = $params['dayList'] ?? []; - $gameId = $params['game_id'] ?? 0; - $serverId = $params['server_id'] ?? 0; - $ids = $params['promote_id'] ?? []; - $isBan = $params['is_ban'] ?? false; - - $map = []; - $map['pay_status']=1; - if ($gameId > 0) { - $map['game_id'] = $gameId; - } - if ($serverId > 0) { - $map['server_id'] = $serverId; - } - $map['promote_id'] = ['in', $ids]; - $map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + $conditions = $this->getDayGroupConditions($params); $oldMap = $map; $records = []; @@ -165,26 +185,28 @@ class SpendRepository { return $records; } - /** + /** + * 按照游戏统计新增付费用户付费金额 + */ + public function getNewPayAmountGroupByGame($params) { + $beginTime = $params['begin_time'] ?? 0; + $gameIds = $params['game_ids'] ?? []; + $conditions = $this->getGameGroupConditions($params); + $oldConditions = $conditions; + $oldConditions['pay_time'] = ['lt', $beginTime]; + $oldQuery = M('spend', 'tab_')->field('user_id')->where($oldConditions)->group('user_id')->buildSql(); + $map['user_id'] = ['exp', ' not in (' . $oldQuery . ')']; + $items = M('spend', 'tab_')->field('sum(pay_amount) amount, game_id')->where($conditions)->group('game_id')->find(); + return $this->assembleRecords($items, $gameIds, 'amount', 'game_id'); + } + + /** * 统计给定时间前的付费玩家总数 */ - public function getHistoryPayCountByDay($params) { + public function getHistoryPayCountGroupByDay($params) + { $dayList = $params['dayList'] ?? []; - $gameId = $params['game_id'] ?? 0; - $serverId = $params['server_id'] ?? 0; - $ids = $params['promote_id'] ?? []; - $isBan = $params['is_ban'] ?? false; - - $map = []; - $map['pay_status']=1; - if ($gameId > 0) { - $map['game_id'] = $gameId; - } - if ($serverId > 0) { - $map['server_id'] = $serverId; - } - $map['promote_id'] = ['in', $ids]; - $map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + $conditions = $this->getDayGroupConditions($params); $records = []; foreach ($dayList as $day) { @@ -195,4 +217,16 @@ class SpendRepository { } return $records; } + + /** + * 统计给定时间前的付费玩家总数 + */ + public function getHistoryPayCountGroupByGame($params) + { + $beginTime = $params['begin_time'] ?? 0; + $conditions = $this->getGameGroupConditions($params); + $conditions['pay_time'] = ['elt', $beginTime]; + $items = M('spend', 'tab_')->field('count(DISTINCT user_id) as count, game_id')->where($conditions)->group('game_id')->find(); + return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); + } } \ No newline at end of file diff --git a/Application/Base/Repository/UserRepository.class.php b/Application/Base/Repository/UserRepository.class.php index af2b7adbf..696379bb5 100644 --- a/Application/Base/Repository/UserRepository.class.php +++ b/Application/Base/Repository/UserRepository.class.php @@ -8,79 +8,115 @@ class UserRepository { } - private function assembleDayRecords($items, $dayList, $valueColumn, $dayColumn = 'day') + private function assembleRecords($items, $keys, $valueColumn, $keyColumn = 'day') { $records = []; - foreach ($dayList as $day) { - $dayValue = 0; + foreach ($keys as $key) { + $value = 0; foreach ($items as $item) { - if ($item[$dayColumn] == $day) { - $dayValue = $item[$valueColumn]; + if ($item[$keyColumn] == $key) { + $value = $item[$valueColumn]; } } - $records[$day] = $dayValue; + $records[$key] = $value; } return $records; } - /** - * 按照时间分组统计登录总数 - */ - public function getLoginCountByDay($params) { + private function getDayGroupConditions($params) + { $beginTime = $params['begin_time'] ?? 0; $endTime = $params['end_time'] ?? 0; $gameId = $params['game_id'] ?? 0; $serverId = $params['server_id'] ?? 0; $ids = $params['promote_id'] ?? []; - $dayList = $params['dayList'] ?? []; - - $map = []; - $map['login_time'] = ['between', [$beginTime, $endTime]]; + $conditions = []; + $conditions['promote_id'] = ['in', $ids]; + $conditions[$params['time_column']] = ['between', [$beginTime, $endTime]]; if ($gameId > 0) { - $map['game_id'] = $gameId; + $conditions['game_id'] = $gameId; } if ($serverId > 0) { - $map['server_id'] = $serverId; + $conditions['server_id'] = $serverId; } - $map['promote_id'] = ['in', $ids]; + $conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + + return $conditions; + } + + private function getGameGroupConditions($params) + { + $beginTime = $params['begin_time'] ?? 0; + $endTime = $params['end_time'] ?? 0; + $ids = $params['promote_ids'] ?? []; + $gameIds = $params['game_ids'] ?? []; + + $conditions = []; + $conditions['promote_id'] = ['in', $ids]; + $conditions[$params['time_column']] = ['between', [$beginTime, $endTime]]; + $conditions['game_id'] = ['in', $gameIds]; + return $conditions; + } + /** + * 按照时间分组统计登录总数 + */ + public function getLoginCountGroupByDay($params) { + $dayList = $params['dayList'] ?? []; + $params['time_column'] = 'login_time'; + $conditions = $this->getDayGroupConditions($params); $items = M('user_login_record', 'tab_')->field('FROM_UNIXTIME(login_time, "%Y-%m-%d") as day, count(DISTINCT user_id) as count') - ->where($map) + ->where($conditions) ->group('day') ->select(); - return $this->assembleDayRecords($items, $dayList, 'count'); + return $this->assembleRecords($items, $dayList, 'count'); + } + + /** + * 按照游戏分组统计登录总数 + */ + public function getLoginCountGroupByGame($params) { + $gameIds = $params['game_ids'] ?? []; + $params['time_column'] = 'login_time'; + $conditions = $this->getGameGroupConditions($params); + $items = M('user_login_record', 'tab_')->field('game_id, count(DISTINCT user_id) as count') + ->where($conditions) + ->group('game_id') + ->select(); + + return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); } /** * 按照时间分组统计注册总数 */ - public function getRegisterCountByDay($params) { - $beginTime = $params['begin_time'] ?? 0; - $endTime = $params['end_time'] ?? 0; - $gameId = $params['game_id'] ?? 0; - $serverId = $params['server_id'] ?? 0; - $ids = $params['promote_id'] ?? []; + public function getRegisterCountGroupByDay($params) { $dayList = $params['dayList'] ?? []; - - $dateform = '%Y-%m-%d'; - - $map = []; - $map['register_time'] = ['between', [$beginTime, $endTime]]; - - if ($gameId > 0) { - $map['fgame_id'] = $gameId; - } - - $map['promote_id'] = ['in', $ids]; - $map['puid'] = 0; - - $items = M('user', 'tab_')->field('count(*) count, FROM_UNIXTIME(register_time,"'.$dateform.'") as day') + $params['time_column'] = 'register_time'; + $conditions = $this->getDayGroupConditions($params); + + $items = M('user', 'tab_')->field('count(*) count, FROM_UNIXTIME(register_time, "%Y-%m-%d") as day') ->where($map) ->group('day') ->select(); - return $this->assembleDayRecords($items, $dayList, 'count'); + return $this->assembleRecords($items, $dayList, 'count'); + } + + /** + * 按照游戏分分组统计注册总数 + */ + public function getRegisterCountGroupByGame($params) { + $gameIds = $params['game_ids'] ?? []; + $params['time_column'] = 'register_time'; + $conditions = $this->getGameGroupConditions($params); + + $items = M('user', 'tab_')->field('count(*) count, game_id') + ->where($conditions) + ->group('game_id') + ->select(); + return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); } /** @@ -95,7 +131,6 @@ class UserRepository { */ public function getRatentionRate($newslist,$game_id=0,$promote_id=0,$flag=1) { - $map['lock_status']=1; if($game_id>0) { $map['up.game_id'] = $game_id; diff --git a/Application/Home/Common/function.php b/Application/Home/Common/function.php index 1bf7886f3..a6007b121 100644 --- a/Application/Home/Common/function.php +++ b/Application/Home/Common/function.php @@ -831,24 +831,24 @@ function isParentPromote($parentId, $promoteId) } //获取所有该类型的渠道 $promoteId-渠道ID $promoteType-1:本账号 2:组长 3:推广员 -function getAllPromoteListByType($promoteType = 1, $retOne = false) +function getAllPromoteListByType($promoteType = 1, $retOne = false, $promoteId = PID) { $childPromoteData = array(); switch ($promoteType) { case 1: - $map['id'] = PID; + $map['id'] = $promoteId; break; case 2: case 3: - $promoteData = D('Promote')->where(array('id' => PID))->find(); + $promoteData = D('Promote')->where(array('id' => $promoteId))->find(); if ($promoteData['grand_id'] > 0) { return []; } elseif ($promoteData['parent_id'] > 0) { $promoteType--; } - $childPromoteIds = getAllPromoteIdsByType((string)PID, $promoteType); + $childPromoteIds = getAllPromoteIdsByType((string)$promoteId, $promoteType); break; } @@ -901,10 +901,10 @@ function getAllPromoteIdsByType($promoteIds, $level = 3, $nowLevel = 1) } //获取所有子渠道列表 $type 1-返回数组 2-返回id数组 3-返回id字符串 -function getAllChildPromoteList($type = 1) +function getAllChildPromoteList($type = 1, $promoteId = PID) { $childPromoteData = array(); - $childPromoteIds = getAllChildPromoteIds((string)PID); + $childPromoteIds = getAllChildPromoteIds((string)$promoteId); if (!empty($childPromoteIds)) { $map['id'] = ['in', $childPromoteIds]; diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index 385379e8c..ffc5136cb 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -172,7 +172,8 @@ class BaseController extends HomeController{ 'p' => $page, 'row' => $pageSize ]; - $pagination = set_pagination($count, $pageSize, $_POST); + $params = array_merge($params, $_POST); + $pagination = set_pagination($count, $pageSize, $params); return [$records, $pagination, $count]; } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 6ab6a23ff..933295615 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -44,14 +44,21 @@ class QueryController extends BaseController $map['tab_spend.promote_id'] = ['in', $childPromoteIds]; } - $teamLeaderId = I('team_leader_id');//组长账号 + $teamLeaderId = intval(I('team_leader_id'));//组长账号 if (!empty($teamLeaderId)) { $hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId); if ($hasTeamLeaderPermission === false) { $this->error('组长权限异常'); } - $map['tab_spend.promote_id'] = $teamLeaderId; + $childPromoteIds = getAllChildPromoteList(3, $teamLeaderId); + if (empty($childPromoteIds)) { + $map['tab_spend.promote_id'] = $teamLeaderId; + } else { + $childPromoteIds = $teamLeaderId . ',' . $childPromoteIds; + + $map['tab_spend.promote_id'] = ['in', $childPromoteIds]; + } } $promoteId = I('promote_id');//推广员账号 @@ -61,18 +68,10 @@ class QueryController extends BaseController $this->error('推广员权限异常'); } - if (!empty($map['tab_spend.promote_id'])) { - $map['_string'] = 'tab_spend.promote_id = ' . $promoteId; - } else { - $map['tab_spend.promote_id'] = $promoteId; - } + $map['tab_spend.promote_id'] = $promoteId; } if (!empty(I('own_id'))) { - if (!empty($map['_string'])) { - unset($map['_string']); - } - $map['tab_spend.promote_id'] = I('own_id');//本账号 } @@ -146,6 +145,7 @@ class QueryController extends BaseController empty(I('own_id')) || $parameter['own_id'] = I('own_id'); empty(I('begtime')) || $parameter['begtime'] = I('begtime'); empty(I('endtime')) || $parameter['endtime'] = I('endtime'); + !isset($_REQUEST['pay_way']) || $parameter['pay_way'] = I('pay_way'); $serverData = $this->getServer(I('relation_game_id'), I('sdk_version')); @@ -163,6 +163,9 @@ class QueryController extends BaseController $this->assign('pID', PID); $this->assign('ownId', I('own_id')); $this->assign('payWayData', QueryController::$payWay); + if (!empty(I('team_leader_id'))) { + $this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id')))); + } $this->meta_title = "订单查询"; $this->display(); } @@ -185,14 +188,21 @@ class QueryController extends BaseController $map['tab_user.promote_id'] = ['in', $childPromoteIds]; } - $teamLeaderId = I('team_leader_id');//组长账号 + $teamLeaderId = intval(I('team_leader_id'));//组长账号 if (!empty($teamLeaderId)) { $hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId); if ($hasTeamLeaderPermission === false) { $this->error('组长权限异常'); } - $map['tab_user.promote_id'] = $teamLeaderId; + $childPromoteIds = getAllChildPromoteList(3, $teamLeaderId); + if (empty($childPromoteIds)) { + $map['tab_user.promote_id'] = $teamLeaderId; + } else { + $childPromoteIds = $teamLeaderId . ',' . $childPromoteIds; + + $map['tab_user.promote_id'] = ['in', $childPromoteIds]; + } } $promoteId = I('promote_id');//推广员账号 @@ -202,18 +212,10 @@ class QueryController extends BaseController $this->error('推广员权限异常'); } - if (!empty($map['tab_user.promote_id'])) { - $map['_string'] = 'tab_user.promote_id = ' . $promoteId; - } else { - $map['tab_user.promote_id'] = $promoteId; - } + $map['tab_user.promote_id'] = $promoteId; } if (!empty(I('own_id'))) { - if (!empty($map['_string'])) { - unset($map['_string']); - } - $map['tab_user.promote_id'] = I('own_id');//本账号 } @@ -276,6 +278,9 @@ class QueryController extends BaseController $this->assign('thisParentPromoteId', $thisParentPromoteId); $this->assign('pID', PID); $this->assign('ownId', I('own_id')); + if (!empty(I('team_leader_id'))) { + $this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id')))); + } $this->meta_title = '注册明细'; $this->display(); } @@ -703,14 +708,14 @@ class QueryController extends BaseController if (intval($endTime - $beginTime) / (24 * 3600) <= 30) { $userRepository = new UserRepository(); $spendRepository = new SpendRepository(); - $payGameCountList = $spendRepository->getPayGameCountByDay($params); - $payUserCountList = $spendRepository->getPayUserCountByDay($params); - $newPayUserCountList = $spendRepository->getNewPayUserCountByDay($params); - $payAmountList = $spendRepository->getPayAmountByDay($params); - $newPayAmountList = $spendRepository->getNewPayAmountByDay($params); - $historyPayCountList = $spendRepository->getHistoryPayCountByDay($params); - $loginCountList = $userRepository->getLoginCountByDay($params); - $registerCountList = $userRepository->getRegisterCountByDay($params); + $payGameCountList = $spendRepository->getPayGameCountGroupByDay($params); + $payUserCountList = $spendRepository->getPayUserCountGroupByDay($params); + $newPayUserCountList = $spendRepository->getNewPayUserCountGroupByDay($params); + $payAmountList = $spendRepository->getPayAmountGroupByDay($params); + $newPayAmountList = $spendRepository->getNewPayAmountGroupByDay($params); + $historyPayCountList = $spendRepository->getHistoryPayCountGroupByDay($params); + $loginCountList = $userRepository->getLoginCountGroupByDay($params); + $registerCountList = $userRepository->getRegisterCountGroupByDay($params); foreach ($dayList as $day) { $records[] = [ @@ -743,10 +748,30 @@ class QueryController extends BaseController public function gameArpu() { - $time = I('time'); - $data = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote_id])->order('game_id desc')->select(); + $promote = $this->getLoginPromote(); + $map = [ + '_logic' => 'or', + 'id' => $promote['id'], + 'parent_id' => $promote['id'], + 'grand_id' => $promote['id'], + ]; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); - + $time = I('time', date('Y-m-d')); + $applys = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote['id']])->order('game_id desc')->select(); + $gameIds = array_column($applys, 'game_id'); + + $params = [ + 'begin_time' => strtotime($time . ' 00:00:00'), + 'end_time' => strtotime($time . ' 23:59:59'), + 'game_ids' => $gameIds, + 'promote_ids' => $ids, + ]; + + $spendRepository = new SpendRepository(); + // $result = $spendRepository->getHistoryPayCountGroupByGame($params); + $result = $spendRepository->getPayGameCountGroupByGame($params); + var_dump($result); } public function arpu_analysis() @@ -978,16 +1003,25 @@ class QueryController extends BaseController $spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds]; } - $teamLeaderId = I('team_leader_id');//组长账号 + $teamLeaderId = intval(I('team_leader_id'));//组长账号 if (!empty($teamLeaderId)) { $hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId); if ($hasTeamLeaderPermission === false) { $this->error('组长权限异常'); } - $userPlayInfoWhere['tab_user_play_info.promote_id'] = $teamLeaderId; - $userGameLoginWhere['tab_user_game_login_record.promote_id'] = $teamLeaderId; - $spendWhere['tab_spend.promote_id'] = $teamLeaderId; + $childPromoteIds = getAllChildPromoteList(3, $teamLeaderId); + if (empty($childPromoteIds)) { + $userPlayInfoWhere['tab_user_play_info.promote_id'] = $teamLeaderId; + $userGameLoginWhere['tab_user_game_login_record.promote_id'] = $teamLeaderId; + $spendWhere['tab_spend.promote_id'] = $teamLeaderId; + } else { + $childPromoteIds = $teamLeaderId . ',' . $childPromoteIds; + + $userPlayInfoWhere['tab_user_play_info.promote_id'] = ['in', $childPromoteIds]; + $userGameLoginWhere['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds]; + $spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds]; + } } $promoteId = I('promote_id');//推广员账号 @@ -997,24 +1031,12 @@ class QueryController extends BaseController $this->error('推广员权限异常'); } - if (!empty($userPlayInfoWhere['tab_apply.promote_id'])) { - $userPlayInfoWhere['_string'] = 'tab_user_play_info.promote_id = ' . $promoteId; - $userGameLoginWhere['_string'] = 'tab_user_game_login_record.promote_id = ' . $promoteId; - $spendWhere['_string'] = 'tab_spend.promote_id = ' . $promoteId; - } else { - $userPlayInfoWhere['tab_user_play_info.promote_id'] = $promoteId; - $userGameLoginWhere['tab_user_game_login_record.promote_id'] = $promoteId; - $spendWhere['tab_spend.promote_id'] = $promoteId; - } + $userPlayInfoWhere['tab_user_play_info.promote_id'] = $promoteId; + $userGameLoginWhere['tab_user_game_login_record.promote_id'] = $promoteId; + $spendWhere['tab_spend.promote_id'] = $promoteId; } if (!empty(I('own_id'))) { - if (!empty($userPlayInfoWhere['_string'])) { - unset($userPlayInfoWhere['_string']); - unset($userGameLoginWhere['_string']); - unset($spendWhere['_string']); - } - $userPlayInfoWhere['tab_user_play_info.promote_id'] = I('own_id'); $userGameLoginWhere['tab_user_game_login_record.promote_id'] = I('own_id'); $spendWhere['tab_spend.promote_id'] = I('own_id'); @@ -1202,6 +1224,9 @@ class QueryController extends BaseController $this->assign('serverData', $serverData['data']); $this->assign('thisParentPromoteId', $thisParentPromoteId); $this->assign('pID', PID); + if (!empty(I('team_leader_id'))) { + $this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id')))); + } $this->display(); } @@ -1236,10 +1261,20 @@ class QueryController extends BaseController $this->error('组长权限异常'); } - $map['tab_apply.promote_id'] = $teamLeaderId; - $userPlayInfoMap['tab_user_play_info.promote_id'] = $teamLeaderId; - $userGameLoginMap['tab_user_game_login_record.promote_id'] = $teamLeaderId; - $spendMap['tab_spend.promote_id'] = $teamLeaderId; + $childPromoteIds = getAllChildPromoteList(3, $teamLeaderId); + if (empty($childPromoteIds)) { + $map['tab_apply.promote_id'] = $teamLeaderId; + $userPlayInfoMap['tab_user_play_info.promote_id'] = $teamLeaderId; + $userGameLoginMap['tab_user_game_login_record.promote_id'] = $teamLeaderId; + $spendMap['tab_spend.promote_id'] = $teamLeaderId; + } else { + $childPromoteIds = $teamLeaderId . ',' . $childPromoteIds; + + $map['tab_apply.promote_id'] = ['in', $childPromoteIds]; + $userPlayInfoMap['tab_user_play_info.promote_id'] = ['in', $childPromoteIds]; + $userGameLoginMap['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds]; + $spendMap['tab_spend.promote_id'] = ['in', $childPromoteIds]; + } } $promoteId = intval(I('promote_id'));//推广员账号 @@ -1249,21 +1284,14 @@ class QueryController extends BaseController $this->error('推广员权限异常'); } - $map['_string'] = 'tab_apply.promote_id = ' . $promoteId; - $userPlayInfoMap['_string'] = 'tab_user_play_info.promote_id = ' . $promoteId; - $userGameLoginMap['_string'] = 'tab_user_game_login_record.promote_id = ' . $promoteId; - $spendMap['_string'] = 'tab_spend.promote_id = ' . $promoteId; + $map['tab_apply.promote_id'] = $promoteId; + $userPlayInfoMap['tab_user_play_info.promote_id'] = $promoteId; + $userGameLoginMap['tab_user_game_login_record.promote_id'] = $promoteId; + $spendMap['tab_spend.promote_id'] = $promoteId; } $ownId = intval(I('own_id'));//本账号 if (!empty($ownId)) { - if (!empty($map['_string'])) { - unset($map['_string']); - unset($userPlayInfoMap['_string']); - unset($userGameLoginMap['_string']); - unset($spendMap['_string']); - } - $map['tab_apply.promote_id'] = $ownId; $userPlayInfoMap['tab_user_play_info.promote_id'] = $ownId; $userGameLoginMap['tab_user_game_login_record.promote_id'] = $ownId; @@ -1456,6 +1484,9 @@ class QueryController extends BaseController $this->assign('serverData', $serverData['data']); $this->assign('thisParentPromoteId', $thisParentPromoteId); $this->assign('pID', PID); + if (!empty(I('team_leader_id'))) { + $this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id')))); + } $this->display(); } @@ -2145,4 +2176,21 @@ class QueryController extends BaseController $this->assign('count', $count); $this->display(); } + + public function getChildPromoteList() + { + $promoteId = I('post.promote_id', 0); + if ($promoteId == 0) { + $data['status'] = 0; + $data['msg'] = '数据异常'; + + $this->ajaxReturn($data); + } + + $promoteList = getAllPromoteListByType(3, false, $promoteId); + $data['status'] = 1; + $data['data'] = $promoteList; + + $this->ajaxReturn($data); + } } diff --git a/Application/Home/Controller/TestResourceController.class.php b/Application/Home/Controller/TestResourceController.class.php index 3c9ca4306..d20157bf8 100644 --- a/Application/Home/Controller/TestResourceController.class.php +++ b/Application/Home/Controller/TestResourceController.class.php @@ -37,6 +37,7 @@ class TestResourceController extends BaseController $map['tab_test_resource.promote_account']=I('promote_name'); } + $map['user.promote_id']=session("promote_auth.pid"); $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') @@ -44,6 +45,7 @@ class TestResourceController extends BaseController ->page($page,$row) ->order('tab_test_resource.create_time DESC') ->select(); +// echo M('test_resource','tab_')->_sql();die(); foreach ($data as $key => $value) { $data[$key]['create_time'] = date('Y-m-d H:m:i',$value['create_time']); diff --git a/Application/Home/View/default/Apply/feature.html b/Application/Home/View/default/Apply/feature.html index a5815a975..86e5dd89c 100644 --- a/Application/Home/View/default/Apply/feature.html +++ b/Application/Home/View/default/Apply/feature.html @@ -215,7 +215,7 @@
- 查看详情{$vo.id} + 查看详情
diff --git a/Application/Home/View/default/Apply/index.html b/Application/Home/View/default/Apply/index.html index 8746e93da..6b99364ce 100644 --- a/Application/Home/View/default/Apply/index.html +++ b/Application/Home/View/default/Apply/index.html @@ -105,7 +105,7 @@ -
+
当前位置:游戏管理>{$position}
@@ -180,10 +180,11 @@
-
+ +
- +
-
+
@@ -869,5 +870,21 @@ $('#promote_id').on('change', function () { newPromoteId = $(this).val(); }); + + $('#submit').click(function () { + var url = $(this).attr('url'); + console.log(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; + + }); diff --git a/Application/Home/View/default/Apply/my_game.html b/Application/Home/View/default/Apply/my_game.html index 71be12117..599867866 100644 --- a/Application/Home/View/default/Apply/my_game.html +++ b/Application/Home/View/default/Apply/my_game.html @@ -89,7 +89,7 @@ -
+
当前位置:游戏管理>{$position}
@@ -156,10 +156,11 @@ -
+ +
- +
-
+
@@ -1031,5 +1032,21 @@ clipboard.on('error', function(e) { // console.log(e); }); + + $('#submit').click(function () { + var url = $(this).attr('url'); + console.log(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; + + }); diff --git a/Application/Home/View/default/GameDivide/index.html b/Application/Home/View/default/GameDivide/index.html index 39bd2c94d..03ff2e4ba 100644 --- a/Application/Home/View/default/GameDivide/index.html +++ b/Application/Home/View/default/GameDivide/index.html @@ -135,7 +135,7 @@ -
+
当前位置:游戏管理>分成比例
@@ -150,8 +150,8 @@
@@ -314,6 +315,22 @@ $('.btn-security-close').on('click', function () { window.location.href = "{:U('Promote/index')}"; }); + + $('#submit').click(function () { + var url = $(this).attr('url'); + console.log(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; + + }); }); diff --git a/Application/Home/View/default/PromoteCoin/coinRecord.html b/Application/Home/View/default/PromoteCoin/coinRecord.html index 9fe3e5f41..ecd5f6863 100644 --- a/Application/Home/View/default/PromoteCoin/coinRecord.html +++ b/Application/Home/View/default/PromoteCoin/coinRecord.html @@ -107,7 +107,7 @@ -
+
返回
@@ -119,10 +119,11 @@
@@ -204,7 +205,7 @@
- 导出 + {$_page}
@@ -254,6 +255,28 @@ $('.back-btn').on('click', function () { history.back(-1); }); + + $('#submit').click(function () { + var sdate = $('#start_time').val(); + var edate = $('#end_time').val(); + if (Date.parse(sdate) > Date.parse(edate)) { + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + var url = $(this).attr('url'); + console.log(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; + + }); }); diff --git a/Application/Home/View/default/PromoteCoin/myCoin.html b/Application/Home/View/default/PromoteCoin/myCoin.html index 6064bab12..cdb210be1 100644 --- a/Application/Home/View/default/PromoteCoin/myCoin.html +++ b/Application/Home/View/default/PromoteCoin/myCoin.html @@ -103,7 +103,7 @@ -
+
当前位置:平台币管理>我的平台币
@@ -112,10 +112,11 @@
@@ -191,7 +192,7 @@
- 导出 + {$_page}
@@ -206,6 +207,22 @@ $(document).ready(function () { $(".select_gallery").select2(); + + $('#submit').click(function () { + var url = $(this).attr('url'); + console.log(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; + + }); }); diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index fb5093735..9c9380ebf 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -71,7 +71,12 @@ diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index 7982e7b71..3263d37b3 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -74,7 +74,7 @@
- +
diff --git a/Application/Home/View/default/Query/dailySummary.html b/Application/Home/View/default/Query/dailySummary.html index 035a716d2..54ff2d148 100644 --- a/Application/Home/View/default/Query/dailySummary.html +++ b/Application/Home/View/default/Query/dailySummary.html @@ -89,7 +89,12 @@
@@ -447,6 +452,36 @@ setValue('server_id', {$Think.request.server_id |default = '""'}); setValue('row', '{:I("get.row",10)}'); + $('#team_leader_id').change(function () { + var promoteId = parseInt($(this).val()); + var promoteValue = $(this).find("option:selected").text(); + + $.ajax({ + url: "{:U('getChildPromoteList')}", + type: "post", + data: {promote_id:promoteId}, + dataType: 'json', + success: function (data) { + var html = ""; + html += ""; + + if (data.status == 1) { + var promoteData = data.data; + + if (promoteData.length > 0) { + for (var i in promoteData) { + html += ""; + } + } + } + + $("#promote_id").empty(); + $('#promote_id').html(html); + $("#promote_id").select2(); + } + }); + }); + $('#own').on('click', function () { var ownId = $('#own_id').val(); var checkBox = $(this).children('i'); diff --git a/Application/Home/View/default/Query/recharge.html b/Application/Home/View/default/Query/recharge.html index 5a3fa6638..a058c0b95 100644 --- a/Application/Home/View/default/Query/recharge.html +++ b/Application/Home/View/default/Query/recharge.html @@ -52,7 +52,7 @@ right: 10px; } -