diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index a3a75f42a..c704aec94 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -926,7 +926,6 @@ public function auto_rrdae(){ { if (isset($map['pay_time'])) { $map['pay_status'] = 1; - $map['pay_game_status'] = 1; $map['game_player_id'] = ['gt', 0]; $map['server_id'] = ['gt', 0]; $field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,promote_id,user_id,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; @@ -955,4 +954,84 @@ public function auto_rrdae(){ } } } + + //用户推广员数据刷新 + public function updateUserPromoteAccount() + { + $map['promote_id'] = ['gt', 0]; + $map['_string'] = "promote_account = '' or promote_account = '自然注册' or promote_account = '官方渠道' or promote_account is NULL"; + $userModel = M('user', 'tab_'); + $userPlayModel = M('user_play', 'tab_'); + $userPlayInfoModel = M('user_play_info', 'tab_'); + $userData = $userModel->field('id,promote_id')->where($map)->select(); + $userPlayData = $userPlayModel->field('id,promote_id')->where($map)->select(); + $userPlayInfoData = $userPlayInfoModel->field('id,promote_id')->where($map)->select(); + $promoteData = []; + + $userRet = $this->updateUserPromoteAccountSql($userModel, $userData, $promoteData); + $userSuccess = $userRet['success']; + $userError = $userRet['error']; + $userErrorData = empty($userRet['error_data']) ? '' : implode(',', $userRet['error_data']); + $promoteData = $userRet['promote_data']; + $userAll = count($userData); + unset($userData); + + $userPlayRet = $this->updateUserPromoteAccountSql($userPlayModel, $userPlayData, $promoteData); + $userPlaySuccess = $userPlayRet['success']; + $userPlayError = $userPlayRet['error']; + $userPlayErrorData = empty($userPlayRet['error_data']) ? '' : implode(',', $userPlayRet['error_data']); + $promoteData = $userPlayRet['promote_data']; + $userPlayAll = count($userPlayData); + unset($userPlayData); + + $userPlayInfoRet = $this->updateUserPromoteAccountSql($userPlayInfoModel, $userPlayInfoData, $promoteData); + $userPlayInfoSuccess = $userPlayInfoRet['success']; + $userPlayInfoError = $userPlayInfoRet['error']; + $userPlayInfoErrorData = empty($userPlayInfoRet['error_data']) ? '' : implode(',', $userPlayInfoRet['error_data']); + $promoteData = $userPlayInfoRet['promote_data']; + $userPlayInfoAll = count($userPlayInfoData); + unset($userPlayInfoData); + + echo "tab_user:all--{$userAll} success--{$userSuccess} error--{$userError} error_ids--{$userErrorData}"; + echo '
'; + echo "tab_user_play:all--{$userPlayAll} success--{$userPlaySuccess} error--{$userPlayError} error_ids--{$userPlayErrorData}"; + echo '
'; + echo "tab_user_play_info:all--{$userPlayInfoAll} success--{$userPlayInfoSuccess} error--{$userPlayInfoError} error_ids--{$userPlayInfoErrorData}"; + echo '
'; + } + + private function updateUserPromoteAccountSql($model, $data = [], $promoteData = []) + { + $success = 0; + $error = 0; + $errorData = []; + foreach ($data as &$list) { + if (isset($promoteData[$list['promote_id']])) { + $promoteAccount = $promoteData[$list['promote_id']]; + } else { + $promoteAccount = M('promote', 'tab_')->where(array('id' => $list['promote_id']))->getField('account'); + $promoteAccount = empty($promoteAccount) ? '未知推广员' : $promoteAccount; + $promoteData[$list['promote_id']] = $promoteAccount; + } + + $save['id'] = $list['id']; + $save['promote_account'] = $promoteAccount; + $res = $model->save($save); + if ($res === false) { + $error++; + $errorData = $list['id']; + } else { + $success++; + } + unset($list); + } + + $ret = [ + 'success' => $success, + 'error' => $error, + 'error_data' => $errorData, + 'promote_data' => $promoteData, + ]; + return $ret; + } } diff --git a/Application/Admin/Controller/AutoPackController.class.php b/Application/Admin/Controller/AutoPackController.class.php index 622619e61..e7da748cd 100644 --- a/Application/Admin/Controller/AutoPackController.class.php +++ b/Application/Admin/Controller/AutoPackController.class.php @@ -319,7 +319,7 @@ class AutoPackController extends Think $launchCountList = M('apply_launch', 'tab_')->field(['apply_id', 'count(*) count'])->where(['apply_id' => ['in', $applyIds]])->group('apply_id')->select(); $launchCountList = index_by_column('apply_id', $launchCountList); - $gameSources = M('game_source', 'tab_')->field(['id', 'file_name', 'source_version', 'file_type', 'bao_name', 'game_id'])->where(['game_id' => ['in', $gameIds]])->select(); + $gameSources = M('game_source', 'tab_')->field(['id', 'file_name', 'source_version', 'file_type', 'bao_name', 'game_id', 'is_new_sdk'])->where(['game_id' => ['in', $gameIds]])->select(); $gameSources = index_by_column('game_id', $gameSources); $gameSourceService = new GameSourceService(); diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 80f10074a..7cd7b86cb 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -102,15 +102,21 @@ class ExportController extends Controller break; case 2: $xlsName = $xlsName?$xlsName:"渠道注册"; +// $xlsCell = array( +// array('account', "玩家账号"), +// array('fgame_name', "注册游戏"), +// array('promote_account', L('Subordinate_channel')), +// array('register_time', L('Registration_time'), 'time_format', '*'), +// array('register_ip', L('Register_iP')), +// array('parent_id', "上级推广员"), +// array('ba_id', '商务专员'), +// ); + $xlsCell = array( - array('account', "玩家账号"), - array('fgame_name', "注册游戏"), - array('promote_account', L('Subordinate_channel')), - array('register_time', L('Registration_time'), 'time_format', '*'), - array('register_ip', L('Register_iP')), - array('parent_id', "上级推广员"), - array('ba_id', '商务专员', 'get_business_affairs_account', '*'), + "玩家账号", "注册游戏", L('Subordinate_channel'), L('Registration_time'), L('Register_iP'), + "上级推广员", '商务专员', ); + if (isset($_REQUEST['game_name'])) { if ($_REQUEST['game_name'] == L('All')) { unset($_REQUEST['game_name']); @@ -121,16 +127,41 @@ class ExportController extends Controller } $map['tab_user.promote_id'] = array("neq", 0); if (isset($_REQUEST['promote_name'])) { - if ($_REQUEST['promote_name'] == L('All')) { + if ($_REQUEST['promote_name']=='全部') { unset($_REQUEST['promote_name']); - } else if ($_REQUEST['promote_name'] == "官方渠道") { - $map['tab_user.promote_id'] = array("elt", 0); + } elseif ($_REQUEST['promote_name']=='自然注册') { + $map['tab_user.promote_id']=array("elt",0); unset($_REQUEST['promote_name']); } else { - $map['tab_user.promote_id'] = get_promote_id($_REQUEST['promote_name']); + $promoteid = get_promote_id($_REQUEST['promote_name']); + $map['tab_user.promote_id']=array('eq',get_promote_id($_REQUEST['promote_name'])); unset($_REQUEST['promote_name']); + + if (isset($_REQUEST['parent_id'])) { + $parent_id = get_promote_id($_REQUEST['parent_id']); + if ($promoteid == $parent_id) { + $map['tab_user.promote_id'] = $promoteid; + } else { + $parent_id = get_promote_id($_REQUEST['parent_id']); + } + } else { + $map['tab_user.promote_id'] = $promoteid; + } + } + } else { + if (isset($_REQUEST['parent_id'])) { + $parent_id = get_promote_id($_REQUEST['parent_id']); + $pro = M('promote', 'tab_')->field('id,account')->where("chain like '%/{$parent_id}/%'")->select(); + $pro_ids = array_column($pro, 'id'); + $pro_ids[] = get_promote_id($_REQUEST['parent_id']); + if (!empty($pro_ids)) { + $map['tab_user.promote_id'] = ['in',$pro_ids]; + } else { + $map['tab_user.promote_id'] = array('eq',-1); + } } } + if (isset($_REQUEST['is_check']) && $_REQUEST['is_check'] != L('All')) { $map['is_check'] = check_status($_REQUEST['is_check']); unset($_REQUEST['is_check']); @@ -172,7 +203,8 @@ class ExportController extends Controller 'promote_account', 'tab_user.parent_name', 'is_check', - 'tab_promote.ba_id' + 'tab_promote.ba_id', + "REPLACE(substring_index(tab_promote.chain, '/', 2),'/','') as top_promote" ), 'key' => array('tab_user.account', 'tab_game.fgame_name'), 'map' => $map, @@ -180,8 +212,21 @@ class ExportController extends Controller 'title' => "渠道注册", 'template_list' => 'ch_reg_list', ); + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + $name = $model['m_name']; - $xlsData = M($name, "tab_") + $xlsData = M($name, "tab_",'union_table') ->field($model['fields']) ->join($model['join']) ->join($model['joins']) @@ -189,10 +234,65 @@ class ExportController extends Controller ->where($model['map']) ->order($model['order']) ->group($model['group']) - ->select(); - foreach ($xlsData as $key => &$value) { - $xlsData[$key]['parent_id'] = get_top_promote($value['promote_id'], $value['parent_id']); + ->select(false); + + $accessNum = M()->table("({$xlsData}) as a") + ->field("a.id,count(a.account) as count") + ->join("left join tab_promote ON a.top_promote = tab_promote.id") + ->join("left join tab_business_affairs ON tab_business_affairs.id=a.ba_id") + ->order("id desc") + ->find(); + $accessNum =$accessNum['count']; + + $perSize = 2000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + $lastId = 0; + + // $xlsCell = array( +// array('account', "玩家账号"), +// array('fgame_name', "注册游戏"), +// array('promote_account', L('Subordinate_channel')), +// array('register_time', L('Registration_time'), 'time_format', '*'), +// array('register_ip', L('Register_iP')), +// array('parent_id', "上级推广员"), +// array('ba_id', '商务专员'), +// ); + + + for($i = 1; $i <= $pages; $i++) { + $xlsData = M($name, "tab_",'union_table') + ->field($model['fields']) + ->join($model['join']) + ->join($model['joins']) + ->join($model['joinss']) + ->where($model['map']) + ->limit(($i-1)*$perSize ,$perSize) + ->order($model['order']) + ->group($model['group']) + ->select(false); + $xlsData = M()->table("({$xlsData}) as a") + ->field("a.account,a.fgame_name,a.promote_account,a.register_time,a.register_ip,tab_promote.account as parent_id,tab_business_affairs.account as ba_id") + ->join("left join tab_promote ON a.top_promote = tab_promote.id") + ->join("left join tab_business_affairs ON tab_business_affairs.id=a.ba_id") + ->order("a.id desc") + ->select(); + + foreach($xlsData as $value) { + if (!$value['ba_id']) { + $value['ba_id'] = "暂无"; + } + $value['register_time'] = date("Y-m-d H:i:s",$value['register_time']); + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + $lastId = $value['id']; + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 } + fclose($fp); + exit(); break; case 3: if($_REQUEST['type']==2){ @@ -922,28 +1022,76 @@ class ExportController extends Controller } else { $total = sprintf("%.2f", $total); } - $xlsData = D('Spend') - ->field('pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,pay_amount,pay_amount,pay_status,pay_game_status,pay_way,server_name,game_player_name,cost') + + + $xlsCell = array( + "支付订单号","CP订单号", "充值时间", "玩家账号", "游戏名称", L('Subordinate_channel'), "充值ip","区服ID", "游戏区服", + "角色ID","角色名称", "订单金额", "实付金额", "充值方式", L('Order_status'), "游戏通知状态", "消费"."{$total}" + ); + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + $accessNum = D('Spend') + ->field('pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') ->where($map) ->join($tab_promote_join) ->order('pay_time DESC') - ->select(); - $xlsCell = array( - array('pay_order_number', "订单号"), - array('pay_time', "充值时间", 'time_format', '*'), - array('user_account', "玩家账号"), - array('game_name', "游戏名称"), - array('promote_account', L('Subordinate_channel')), - array('spend_ip', "充值ip"), - array('server_name', "游戏区服"), - array('game_player_name', "角色名称"), - array('cost', "订单金额"), - array('pay_amount', "实付金额"), - array('pay_way', "充值方式", 'get_pay_way', '*'), - array('pay_status', L('Order_status'), 'get_info_status', '*', '9'), - array('pay_game_status', "游戏通知状态", 'get_info_status', '*', '14'), - array('', "消费"."{$total}") - ); + ->count(); + + $perSize = 10000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + +// var_dump($count);die(); + for($i = 1; $i <= $pages; $i++) { + $xlsData = D('Spend') + ->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->join($tab_promote_join) + ->order('pay_time DESC') + ->select(); + + foreach($xlsData as $value) { + $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); + $value['pay_way'] = get_pay_way($value['pay_way']); + $value['pay_status'] = get_info_status($value['pay_status'],9); + $value['pay_game_status'] = get_info_status($value['pay_game_status'],14); + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + exit(); +// $xlsCell = array( +// array('pay_order_number', "订单号"), +// array('pay_time', "充值时间", 'time_format', '*'), +// array('user_account', "玩家账号"), +// array('game_name', "游戏名称"), +// array('promote_account', L('Subordinate_channel')), +// array('spend_ip', "充值ip"), +// array('server_name', "游戏区服"), +// array('game_player_name', "角色名称"), +// array('cost', "订单金额"), +// array('pay_amount', "实付金额"), +// array('pay_way', "充值方式", 'get_pay_way', '*'), +// array('pay_status', L('Order_status'), 'get_info_status', '*', '9'), +// array('pay_game_status', "游戏通知状态", 'get_info_status', '*', '14'), +// array('', "消费"."{$total}") +// ); break; case 8: $xlsName = $xlsName?$xlsName:L('Platform_currency_recharge'); @@ -1132,20 +1280,23 @@ class ExportController extends Controller break; case 11: $xlsName = $xlsName?$xlsName:"礼包领取"; +// $xlsCell = array( +// array('user_account', "玩家账号"), +// array('game_name', "游戏名称"), +// array('gift_name', '礼包名称'), +// array('novice', '礼包卡号'), +// array('gift_id', '运营平台', 'get_operation_platform', '*', 'giftbag'), +// array('create_time', '领取时间', 'time_format', '*'), +// ); $xlsCell = array( - array('user_account', "玩家账号"), - array('game_name', "游戏名称"), - array('gift_name', '礼包名称'), - array('novice', '礼包卡号'), - array('gift_id', '运营平台', 'get_operation_platform', '*', 'giftbag'), - array('create_time', '领取时间', 'time_format', '*'), + "玩家账号", "游戏名称", '礼包名称', '礼包卡号', '运营平台', '领取时间', ); if (isset($_REQUEST['game_name'])) { - $extend['game_name'] = trim($_REQUEST['game_name']); + $extend['tab_gift_record.game_name'] = trim($_REQUEST['game_name']); unset($_REQUEST['game_name']); } if (isset($_REQUEST['user_account'])) { - $extend['user_account'] = trim($_REQUEST['user_account']); + $extend['tab_gift_record.user_account'] = trim($_REQUEST['user_account']); unset($_REQUEST['user_account']); } if (isset($_REQUEST['sdk_version'])) { @@ -1155,14 +1306,70 @@ class ExportController extends Controller $map['sdk_version'] = $_REQUEST['sdk_version']; $game_ids = M('game', 'tab_')->field('id')->where($map)->select(); $game_ids = array_column($game_ids, 'id'); - $extend['sdk_version'] = ['in', $game_ids]; + $extend['tab_gift_record.game_id'] = ['in', $game_ids]; unset($_REQUEST['sdk_version']); } } - $xlsData = M('gift_record', 'tab_') +// var_dump($extend);die(); + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + + + + $accessNum = M('gift_record', 'tab_') + ->field("user_account,game_name,gift_name,novice,gift_id,FROM_UNIXTIME(create_time) as create_time") ->where($extend) ->order("id DESC") - ->select(); + ->count(); + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + +// var_dump($count);die(); + for($i = 1; $i <= $pages; $i++) { + + $xlsData = M('gift_record', 'tab_') + ->field("tab_gift_record.user_account,tab_gift_record.game_name,tab_gift_record.gift_name,tab_gift_record.novice,giftbag_version,FROM_UNIXTIME(tab_gift_record.create_time) as create_time") + ->join("left join tab_giftbag on tab_gift_record.gift_id = tab_giftbag.id") + ->where($extend) + ->limit(($i-1)*$perSize ,$perSize) + ->order("tab_gift_record.id DESC") + ->select(); + + foreach($xlsData as $value) { + if($value['giftbag_version']==0){ + $value['giftbag_version']= '双平台'; + }elseif($value['giftbag_version']==1){ + $value['giftbag_version']= "安卓"; + }elseif($value['giftbag_version']==2){ + $value['giftbag_version']= "苹果"; + } else { + $value['giftbag_version']= ""; + } +// $value['gift_id'] = get_operation_platform($value['gift_id'],'giftbag'); + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + exit(); + + break; case 12: get_info_status(); @@ -4880,15 +5087,17 @@ if ($key == 'model'){ array('create_time','注册时间'), array('last_login_time','最后登录时间'), array('promote_levels','渠道类型'), - array('grand_account','上线推广员'), + array('grand_account','所属会长'), array('business_affairs','商务专员'), array('status','状态'), + array('ver_status','身份认证'), + array('oa_associated','OA关联') ); $model = M('Promote','tab_'); if(isset($_REQUEST['promote_id'])){ - $map['id']=$_REQUEST['promote_id']; + $map['tab_promote.id']=$_REQUEST['promote_id']; } if(isset($_REQUEST['admin_id'])){ if($_REQUEST['admin_id']=="全部"){ @@ -4906,14 +5115,29 @@ if ($key == 'model'){ }else{ $zid=$_REQUEST['parent_id']; } - $map['id']=array('in',$zid); + $map['tab_promote.id']=array('in',$zid); } - $map['level'] = I('promote_level'); + if (I("promote_level")) { + $map['level'] = I("promote_level"); + } if(I('oa_associated',-1) != -1) { $map['oa_associated'] = I('oa_associated'); } - } + if (I("ver_status")) { + $map['ver_status'] = I("ver_status"); + } + + if (I("ver_status")) { + $map['tab_promote.ver_status'] = I("ver_status"); + } + + if (I('status')) { + $map['tab_promote.status'] = I('status'); + } + + + } @@ -4924,15 +5148,16 @@ if ($key == 'model'){ $row = $_REQUEST['row']?$_REQUEST['row']:10; - $data=$model - ->where($map) - ->order('create_time desc') - ->select(); + $xlsData = []; - if(is_array($data)){ +// if(is_array($data)){ if($_REQUEST['type']==2) { + $data=$model + ->where($map) + ->order('create_time desc') + ->select(); foreach($data as $k => $v) { $v['create_time'] = date('Y-m-d H:i',$v['create_time']); @@ -4944,22 +5169,88 @@ if ($key == 'model'){ } } else { - foreach($data as $k => $v) { +// sum_promote_total_money() + $xlsData = $model + ->field("tab_promote.id,tab_promote.account,mobile_phone,balance_coin,total_money,tab_promote.create_time + ,tab_promote.last_login_time,tab_business_affairs.account as business_affairs,tab_promote.status, + REPLACE(substring_index(tab_promote.chain, '/', 2),'/','') as top_promote,sum(pay_amount) as pay_amount,tab_promote.level as promote_levels,tab_promote.ver_status,tab_promote.oa_associated") + ->join("left join tab_business_affairs on ba_id = tab_business_affairs.id") + ->join("left join tab_spend on tab_promote.id = tab_spend.promote_id and pay_status=1") + ->where($map) + ->order('create_time desc') + ->group("tab_promote.id") + ->select(false); - $v['create_time'] = date('Y-m-d H:i',$v['create_time']); - $v['last_login_time'] = date('Y-m-d H:i',$v['last_login_time']); + $xlsData = M()->table("({$xlsData}) as a") + ->field("a.id,a.account,a.mobile_phone,a.balance_coin,a.create_time,a.last_login_time, + a.promote_levels,tab_promote.account as grand_account,a.business_affairs,a.status,pay_amount as total_money,a.ver_status,a.oa_associated") + ->join("left join tab_promote on tab_promote.id = a.top_promote") + ->order('a.id desc') + ->select(); + + + foreach($xlsData as $k => &$v) { + + $v['create_time'] = $v['create_time']?date('Y-m-d H:i',$v['create_time']):''; + $v['last_login_time'] = $v['last_login_time']?date('Y-m-d H:i',$v['last_login_time']):'暂无登录'; + if (!$v['business_affairs']) { + $v['business_affairs'] = "暂无"; + } + if (!$v['grand_account']) { + $v['grand_account'] = $v['account']; + } $v['status'] = get_info_status($v['status'],3); - $v['business_affairs'] = get_business_affairs_account($v['ba_id']); - $v['grand_account'] = getTopPromote($v['id'])['id']; - $v['promote_levels'] = get_promote_levels($v['id']); +// $v['business_affairs'] = get_business_affairs_account($v['ba_id']); +// $v['grand_account'] = getTopPromote($v['id'])['id']; +// $v['promote_levels'] = get_promote_levels($v['id']); + + switch ($v['ver_status']) { + case '1': + $v['ver_status'] = "成功"; + break; + case '2': + $v['ver_status'] = "拒绝"; + break; + case '3': + $v['ver_status'] = "正在审核"; + break; + case '4': + $v['ver_status'] = "修改审核中"; + break; + + default: + $v['ver_status'] = '未认证'; + } - $xlsData[] = $v; + switch ($v['promote_levels']) { + case '1': + $v['promote_levels'] = "会长"; + break; + case '2': + $v['promote_levels'] = "部门长"; + break; + case '3': + $v['promote_levels'] = "组长"; + break; + case '4': + $v['promote_levels'] = "组员"; + break; + + default: + $v['promote_levels'] = ''; + } + + if ($v['oa_associated']==1) { + $v['oa_associated'] = "关联"; + } else { + $v['oa_associated'] = "未关联"; + } } - } + } - } +// } $this->exportExcel($xlsName, $xlsCell, $xlsData); @@ -5206,57 +5497,122 @@ if ($key == 'model'){ $model = M('user','tab_'); - $xlsCell = array( - array('account','玩家账号'), - array('register_time','注册时间'), - array('login_time','最后登录时间'), - array('register_type','注册来源'), - array('register_ip','注册IP'), - array('login_time','上次登录'), - array('top_promote','所属推广员'), - ); +// $xlsCell = array( +// array('account','玩家账号'), +// array('register_time','注册时间'), +// array('login_time','最后登录时间'), +// array('register_type','注册来源'), +// array('register_ip','注册IP'), +// array('login_time','上次登录'), +// array('top_promote','所属推广员'), +// ); + $xlsCell = array( + '玩家账号','注册时间','最后登录时间','注册来源','注册IP','上次登录','所属推广员', + ); if(isset($_REQUEST['account'])){ if ($_REQUEST['account']=='全部') { unset($_REQUEST['account']); } - $map['account']=array('like','%'.$_REQUEST['account'].'%'); + $map['tab_user.account']=array('like','%'.$_REQUEST['account'].'%'); unset($_REQUEST['account']); } - $page = intval($_REQUEST['p']); - - $page = $page?$page:1; - - $row = $_REQUEST['row']?$_REQUEST['row']:10; - - - $data=$model - ->where($map) - ->order('id desc') - ->select(); - - $xlsData = []; - - if(is_array($data)){ - - foreach($data as $k => $v) { - - $v['register_time'] = date('Y-m-d H:i:s',$v['register_time']); - $v['login_time'] = $v['login_time']>0?date('Y-m-d H:i:s',$v['login_time']):'暂无登录'; - - $v['register_type'] = get_registertype($v['register_type']); + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + $accessNum=$model + ->join("left join tab_promote on tab_promote.id=tab_user.promote_id") + ->field("tab_user.id,tab_user.account,tab_user.register_time,tab_user.login_time,tab_user.register_type + ,tab_user.register_ip, + tab_promote.parent_name as parent_name, + tab_promote.account as promote_account") + ->where($map) + ->order('tab_user.id desc') + ->count(); + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + $lastId = 0; + + for($i = 1; $i <= $pages; $i++) { + // REPLACE(substring_index(tab_promote.chain, '/', 2),'/','') + $xlsData=$model + ->join("left join tab_promote on tab_promote.id=tab_user.promote_id") + ->field("tab_user.id,tab_user.account,tab_user.register_time,tab_user.login_time,tab_user.register_type + ,tab_user.register_ip,tab_user.login_time as last_login_time, + tab_promote.parent_name as parent_name, + tab_promote.account as promote_account,tab_user.id as top_promote") + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('tab_user.id desc') + ->select(); - $promote = get_parent_promoteto($v['promote_id']); + foreach($xlsData as $key => $value) { + unset($value['id']); + $value['register_time'] = date('Y-m-d H:i:s',$value['register_time']); + $value['login_time'] = $value['login_time']>0?date('Y-m-d H:i:s',$value['login_time']):'暂无登录'; + $value['last_login_time'] = $value['last_login_time']>0?date('Y-m-d H:i:s',$value['last_login_time']):'暂无登录'; + $value['register_type'] = get_registertype($value['register_type']); + $value['top_promote'] = $value['parent_name']?$value['promote_account'].'['.$value['parent_name'].']':$value['promote_account']; + if (!$value['promote_account']) { + $value['top_promote'] = "官方渠道"; + } + if($value['parent_name'] == "官方渠道") { + $value['top_promote'] = $value['promote_account']; + } + unset($value['promote_account']); + unset($value['parent_name']); + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); - $v['top_promote'] = $promote?($v['promote_account'] . get_parent_promoteto($v['promote_id'])):get_promote_name($v['promote_id']); + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + exit(); - $xlsData[] = $v; +// $data = M()->table("({$data}) as a") +// ->field("a.account,a.register_time,a.login_time,a.register_type,a.register_ip,a.top_promote,a.promote_account") +// ->join("left join tab_promote on a.top_promote=tab_promote.id") +// ->order("a.id desc") +// ->select(false); - } +// var_dump($data);die(); +// $xlsData = []; - } +// if(is_array($data)){ +// +// foreach($data as $k => $v) { +// +// $v['register_time'] = date('Y-m-d H:i:s',$v['register_time']); +// $v['login_time'] = $v['login_time']>0?date('Y-m-d H:i:s',$v['login_time']):'暂无登录'; +// +// $v['register_type'] = get_registertype($v['register_type']); +// +// $promote = get_parent_promoteto($v['promote_id']); +// +// $v['top_promote'] = $promote?($v['promote_account'] . get_parent_promoteto($v['promote_id'])):get_promote_name($v['promote_id']); +// +// $xlsData[] = $v; +// +// } +// +// +// } $this->exportExcel($xlsName, $xlsCell, $xlsData); @@ -5557,175 +5913,262 @@ if ($key == 'model'){ } + public function spend_list() + { - public function spend_list() { - - $xlsName = $_REQUEST['xlsname']; + $xlsName = $_REQUEST['xlsname']; - $xlsCell = array( - array('pay_order_number', "订单号"), - array('pay_time', "充值时间"), - array('promote_account', L('Subordinate_channel')), - array('parent_id', "上级推广员"), - array('user_account', "玩家账号"), - array('game_name', "游戏名称"), - array('server_name', L('Game_area_clothing')), - array('game_player_name', "角色名"), - array('spend_ip', "充值ip"), - array('pay_amount', "应付金额"), - array('cost', "实付金额"), - array('pay_way', "充值方式"), - array('promote_id', '商务专员'), - array('is_check','对账状态') - ); +// $xlsCell = array( +// array('pay_order_number', "订单号"), +// array('pay_time', "充值时间"), +// array('promote_account', L('Subordinate_channel')), +// array('parent_id', "上级推广员"), +// array('user_account', "玩家账号"), +// array('game_name', "游戏名称"), +// array('server_name', L('Game_area_clothing')), +// array('game_player_name', "角色名"), +// array('spend_ip', "充值ip"), +// array('pay_amount', "应付金额"), +// array('cost', "实付金额"), +// array('pay_way', "充值方式"), +// array('promote_id', '商务专员'), +// array('is_check','对账状态') +// ); + $xlsCell = array( + "订单号", "充值时间", L('Subordinate_channel'), "上线推广员", "玩家账号", "游戏名称", L('Game_area_clothing'), + "角色名", "充值ip", "应付金额", "实付金额", "充值方式", '商务专员', '对账状态' + ); - if(isset($_REQUEST['game_name'])){ - if($_REQUEST['game_name']=='全部'){ + if (isset($_REQUEST['game_name'])) { + if ($_REQUEST['game_name'] == '全部') { unset($_REQUEST['game_name']); - }else{ - $map['game_name']=$_REQUEST['game_name']; + } else { + $map['game_name'] = $_REQUEST['game_name']; unset($_REQUEST['game_name']); } } - if(!empty($_REQUEST['server_id'])){ - $map['server_name']=$_REQUEST['server_id']; + if (!empty($_REQUEST['server_id'])) { + $map['server_name'] = $_REQUEST['server_id']; unset($_REQUEST['server_id']); } - if(!empty($_REQUEST['pay_order_number'])){ - $map['pay_order_number']=array('like','%'.$_REQUEST['pay_order_number'].'%'); + if (!empty($_REQUEST['pay_order_number'])) { + $map['pay_order_number'] = array('like', '%' . $_REQUEST['pay_order_number'] . '%'); unset($_REQUEST['pay_order_number']); } - if(isset($_REQUEST['pay_way'])){ - $map['pay_way'] = get_pay_way_map($_REQUEST['pay_way']); - unset($_REQUEST['pay_way']); + if (isset($_REQUEST['pay_way'])) { + $map['pay_way'] = get_pay_way_map($_REQUEST['pay_way']); + unset($_REQUEST['pay_way']); } - if(isset($_REQUEST['user_account'])){ - $map['user_account']=array('like','%'.$_REQUEST['user_account'].'%'); + if (isset($_REQUEST['user_account'])) { + $map['user_account'] = array('like', '%' . $_REQUEST['user_account'] . '%'); unset($_REQUEST['user_account']); } - if(isset($_REQUEST['spend_ip'])){ - $map['spend_ip']=array('like','%'.$_REQUEST['spend_ip'].'%'); + if (isset($_REQUEST['spend_ip'])) { + $map['spend_ip'] = array('like', '%' . $_REQUEST['spend_ip'] . '%'); unset($_REQUEST['spend_ip']); } - if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){ - $map['pay_time']=array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1)); - unset($_REQUEST['time-start']);unset($_REQUEST['time_end']); - }elseif(isset($_REQUEST['time-start'])){ - $map['pay_time'] = ['GT',strtotime(I('time-start'))]; + if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) { + $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1)); unset($_REQUEST['time-start']); - }elseif(isset($_REQUEST['time-end'])){ - $map['pay_time'] = ['LT',strtotime(I('time-end'))+86399]; + unset($_REQUEST['time_end']); + } elseif (isset($_REQUEST['time-start'])) { + $map['pay_time'] = ['GT', strtotime(I('time-start'))]; + unset($_REQUEST['time-start']); + } elseif (isset($_REQUEST['time-end'])) { + $map['pay_time'] = ['LT', strtotime(I('time-end')) + 86399]; unset($_REQUEST['time-end']); } - if(isset($_REQUEST['start'])&&isset($_REQUEST['end'])){ - $map['pay_time']=array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1)); - unset($_REQUEST['start']);unset($_REQUEST['end']); - }elseif(isset($_REQUEST['start'])){ - $map['pay_time'] = ['GT',strtotime(I('start'))]; + if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) { + $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['start']), strtotime($_REQUEST['end']) + 24 * 60 * 60 - 1)); unset($_REQUEST['start']); - }elseif(isset($_REQUEST['end'])){ - $map['pay_time'] = ['LT',strtotime(I('end'))+86399]; + unset($_REQUEST['end']); + } elseif (isset($_REQUEST['start'])) { + $map['pay_time'] = ['GT', strtotime(I('start'))]; + unset($_REQUEST['start']); + } elseif (isset($_REQUEST['end'])) { + $map['pay_time'] = ['LT', strtotime(I('end')) + 86399]; unset($_REQUEST['end']); } - if(isset($_REQUEST['promote_name'])){ - if($_REQUEST['promote_name']=='全部'){ + if (isset($_REQUEST['timeStart']) && isset($_REQUEST['timeEnd'])) { + $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['timeStart']), strtotime($_REQUEST['timeEnd']) + 24 * 60 * 60 - 1)); + unset($_REQUEST['timeStart']); + unset($_REQUEST['timeEnd']); + } elseif (isset($_REQUEST['timeStart'])) { + $map['pay_time'] = ['GT', strtotime(I('timeStart'))]; + unset($_REQUEST['timeStart']); + } elseif (isset($_REQUEST['timeEnd'])) { + $map['pay_time'] = ['LT', strtotime(I('timeEnd')) + 86399]; + unset($_REQUEST['timeEnd']); + } + + if (isset($_REQUEST['promote_name'])) { + if ($_REQUEST['promote_name'] == '全部') { unset($_REQUEST['promote_name']); - }else if($_REQUEST['promote_name']=='自然注册'){ - $map['promote_id']=array("lte",0); + } else if ($_REQUEST['promote_name'] == '自然注册') { + $map['promote_id'] = array("lte", 0); unset($_REQUEST['promote_name']); - }else{ - $map['promote_id']=get_promote_id($_REQUEST['promote_name']); + } else { + $map['promote_id'] = get_promote_id($_REQUEST['promote_name']); unset($_REQUEST['promote_name']); - if(!empty(I('parent_id')) && $map['promote_id']){ - - if(I('parent_id') == $map['promote_id']) { + if (!empty(I('parent_id')) && $map['promote_id']) { + if (I('parent_id') == $map['promote_id']) { - } else { - $parent_id = I('parent_id'); - $pro = M('promote','tab_')->field('id')->where("id={$map['promote_id']} and chain like '%/{$parent_id}/%'")->select(); + } else { + $parent_id = I('parent_id'); + $pro = M('promote', 'tab_')->field('id')->where("id={$map['promote_id']} and chain like '%/{$parent_id}/%'")->select(); - if(!$pro) { - $map['promote_id'] = array('eq',999999999); - } + if (!$pro) { + $map['promote_id'] = array('eq', 999999999); + } - } + } - } else { - $pro = M('promote','tab_')->field('id')->where("chain like '%/{$map['promote_id']}/%'")->select(); - $pro_ids = array_column($pro,'id'); - $pro_ids[] = $map['promote_id']; - if (!empty($pro_ids)){ - $map['promote_id'] = ['in',$pro_ids]; - }else{ - $map['promote_id'] = array('eq',999999999); - } + } else { + $pro = M('promote', 'tab_')->field('id')->where("chain like '%/{$map['promote_id']}/%'")->select(); + $pro_ids = array_column($pro, 'id'); + $pro_ids[] = $map['promote_id']; + if (!empty($pro_ids)) { + $map['promote_id'] = ['in', $pro_ids]; + } else { + $map['promote_id'] = array('eq', 999999999); + } - } + } } - }else{ + } else { - if(!empty(I('parent_id'))){ - $parent_id = I('parent_id'); - $pro = M('promote','tab_')->field('id')->where("chain like '%/{$parent_id}/%'")->select(); - $pro_ids = array_column($pro,'id'); - $pro_ids[] = I('parent_id'); - if (!empty($pro_ids)){ - $map['promote_id'] = ['in',$pro_ids]; - }else{ - $map['promote_id'] = array('eq',999999999); - } - } else { - $map['promote_id']=array("gt",0); - } + + if (!empty(I('parent_id'))) { + $parent_id = I('parent_id'); + $pro = M('promote', 'tab_')->field('id')->where("chain like '%/{$parent_id}/%'")->select(); + $pro_ids = array_column($pro, 'id'); + $pro_ids[] = I('parent_id'); + if (!empty($pro_ids)) { + $map['promote_id'] = ['in', $pro_ids]; + } else { + $map['promote_id'] = array('eq', 999999999); + } + } else { + $map['promote_id'] = array("gt", 0); + } } - if(isset($_REQUEST['ba_id'])){ - $all_promote_id = array_column(get_admin_promotes($_REQUEST['ba_id'],'ba_id'),'id'); - if(empty($all_promote_id)){ - $all_promote_id[]=-1; + if (isset($_REQUEST['ba_id'])) { + $all_promote_id = array_column(get_admin_promotes($_REQUEST['ba_id'], 'ba_id'), 'id'); + if (empty($all_promote_id)) { + $all_promote_id[] = -1; } - $map['promote_id']=array($map['promote_id'],array('in',implode(',',$all_promote_id)),'and'); + $map['promote_id'] = array($map['promote_id'], array('in', implode(',', $all_promote_id)), 'and'); } +// var_dump(1);die(); - $map['tab_spend.pay_status'] = 1; + $map['tab_spend.pay_status'] = 1; + $map['tab_spend.promote_id'] = $map['promote_id']; + unset($map['promote_id']); - $xlsData = D('Spend') - // 查询条件 - ->where($map) - /* 默认通过id逆序排列 */ - ->order('id desc') - /* 执行查询 */ - ->select(); + $csvFileName = $xlsName . '.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="' . $csvFileName . '"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - foreach ($xlsData as $key => &$value) { - $xlsData[$key]['parent_id'] = get_top_promote($value['promote_id'], $value['parent_id']); - $xlsData[$key]['pay_way'] = get_pay_way($value['pay_way']); - $xlsData[$key]['promote_id'] = get_promote_business_account($value['promote_id']); - $xlsData[$key]['is_check'] = get_info_status($value['is_check'],37); - $xlsData[$key]['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); - } + $accessNum =D('Spend') + // 查询条件 + ->where($map) + /* 默认通过id逆序排列 */ + ->order('tab_spend.id desc') + /* 执行查询 */ + ->count(); + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + $lastId = 0; + for($i = 1; $i <= $pages; $i++) { + $xlsData = D('Spend') + ->field("tab_spend.pay_order_number,tab_spend.pay_time,promote_account,parent_id,user_account,game_name,server_name,game_player_name, + spend_ip,pay_amount,cost,pay_way,tab_spend.promote_id,is_check,ba_id, + REPLACE(substring_index(tab_promote.chain, '/', 2),'/','') as top_promote,tab_business_affairs.account") + ->join("left join tab_promote on tab_spend.promote_id = tab_promote.id") + ->join("left join tab_business_affairs on tab_promote.ba_id = tab_business_affairs.id") + // 查询条件 + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + /* 默认通过id逆序排列 */ + ->order('tab_spend.id desc') + /* 执行查询 */ + ->select(false); + + // $xlsCell = array( +// array('pay_order_number', "订单号"), +// array('pay_time', "充值时间"), +// array('promote_account', L('Subordinate_channel')), +// array('parent_id', "上级推广员"), +// array('user_account', "玩家账号"), +// array('game_name', "游戏名称"), +// array('server_name', L('Game_area_clothing')), +// array('game_player_name', "角色名"), +// array('spend_ip', "充值ip"), +// array('pay_amount', "应付金额"), +// array('cost', "实付金额"), +// array('pay_way', "充值方式"), +// array('promote_id', '商务专员'), +// array('is_check','对账状态') +// ); - $this->exportExcel($xlsName, $xlsCell, $xlsData); + $xlsData = M()->table("({$xlsData}) as a") + ->field("a.pay_order_number,a.pay_time,a.promote_account,tab_promote.account as parent_id, + a.user_account,a.game_name,a.server_name,a.game_player_name,a.spend_ip,a.pay_amount,a.cost, + a.pay_way,a.account,a.is_check") + ->join("left join tab_promote on a.top_promote=tab_promote.id") + ->select(); - } + + foreach ($xlsData as $key => &$value) { + if (!$value['account']) { + $value['account'] = "暂无"; + } +// $xlsData[$key]['parent_id'] = get_top_promote($value['promote_id'], $value['parent_id']); + $xlsData[$key]['pay_way'] = get_pay_way($value['pay_way']); +// $xlsData[$key]['promote_id'] = get_promote_business_account($value['promote_id']); + $xlsData[$key]['is_check'] = get_info_status($value['is_check'], 37); + $xlsData[$key]['pay_time'] = date('Y-m-d H:i:s', $value['pay_time']); + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + + fclose($fp); + exit(); +// $this->exportExcel($xlsName, $xlsCell, $xlsData); + + } function exportFinanceIndex() { diff --git a/Application/Admin/Controller/FileController.class.php b/Application/Admin/Controller/FileController.class.php index 0e1304463..c96c5d31d 100644 --- a/Application/Admin/Controller/FileController.class.php +++ b/Application/Admin/Controller/FileController.class.php @@ -200,6 +200,14 @@ class FileController extends AdminController /* 调用文件上传组件上传文件 */ $Picture = D('Picture'); $pic_driver = C('PICTURE_UPLOAD_DRIVER'); + + if (I('icon')) { + if ($_FILES['file']['size'] > 51200) { + $return = array('status' => 1001, 'info' => '图片大小不得超过50k', 'data' => ''); + $this->ajaxReturn($return); + } + } + $info = $Picture->upload( $_FILES, C('PICTURE_UPLOAD'), diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index 86d530a69..6cf6890e9 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -290,6 +290,14 @@ class GameController extends ThinkController public function edit($id = null) { if (IS_POST) { + if ($_POST['game_score'] <0 || $_POST['game_score'] > 5) { + $this->error('游戏评分只能为0-5之间的数字!'); + exit; + } + if (mb_strlen($_POST['features']) > 30) { + $this->error('一句话简介不能超过30个字!'); + exit; + } /*if($_POST['apply_status']==0&&$_POST['game_status']==1){ $this->error('游戏未审核不允许显示');//游戏添加完成 }*/ diff --git a/Application/Admin/Controller/ServerNoticeController.class.php b/Application/Admin/Controller/ServerNoticeController.class.php new file mode 100644 index 000000000..51a118437 --- /dev/null +++ b/Application/Admin/Controller/ServerNoticeController.class.php @@ -0,0 +1,260 @@ + + */ +class ServerNoticeController extends ThinkController { + const model_name = 'ServerNotice'; + + public function lists(){ + if(isset($_REQUEST['show_status'])){ + $extend['show_status']=$_REQUEST['show_status']; + unset($_REQUEST['show_status']); + } + if(isset($_REQUEST['server_version'])){ + $extend['server_version']=$_REQUEST['server_version']; + unset($_REQUEST['server_version']); + } + if(isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])){ + $extend['start_time'] = array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1)); + unset($_REQUEST['timestart']);unset($_REQUEST['timeend']); + }elseif(isset($_REQUEST['timestart'])){ + $extend['start_time']=array('EGT',strtotime($_REQUEST['timestart'])); + }elseif(isset($_REQUEST['timeend'])){ + $extend['start_time']=array('ELT',strtotime($_REQUEST['timeend'])); + } + if(isset($_REQUEST['start']) && isset($_REQUEST['end'])){ + $extend['start_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1)); + unset($_REQUEST['start']);unset($_REQUEST['end']); + } + if(isset($_REQUEST['game_name'])){ + if($_REQUEST['game_name']=='全部'){ + unset($_REQUEST['game_name']); + }else{ + $extend['game_name']=['like', "{$_REQUEST['game_name']}%"]; + unset($_REQUEST['game_name']); + } + } + if(isset($_REQUEST['server_name'])){ + $extend['server_name']=$_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } + if(empty($_GET['type']) || $_GET['type'] == 1) { + $extend['developers'] = array('EQ',0); + }else{ + $extend['developers'] = array('NEQ',0); + $this->assign('show_status',1); + } + + $this->m_title = '区服预告'; + $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'ServerNotice/lists','status'=>1])->find()); + + + parent::order_lists(self::model_name,$_GET["p"],$extend); + } + + public function add(){ + $model = M('Model')->getByName(self::model_name); + $this->m_title = '区服预告'; + $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'ServerNotice/lists','status'=>1])->find()); + + parent::add($model["id"]); + } + + public function edit($id=0){ + $id || $this->error('请选择要编辑的用户!'); + $this->m_title = '区服预告'; + $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'ServerNotice/lists','status'=>1])->find()); + + $model = M('Model')->getByName(self::model_name); /*通过Model名称获取Model完整信息*/ + parent::edit($model['id'],$id); + } + + public function del($model = null, $ids=null){ + $model = M('Model')->getByName(self::model_name); /*通过Model名称获取Model完整信息*/ + parent::del($model["id"],$ids); + } + + /** + * 批量导入游戏区服区服 + */ + public function batch(){ + if(IS_POST){ + switch($_POST['batchType']){ + case 1: + $this->batchExcel(); + break; + case 2: + $this->batchImport(); + break; + } + }else{ + $this->meta_title = '新增区服管理'; + + $this->m_title = '区服预告'; + $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Server/lists','status'=>1])->find()); + + $this->display(); + } + + } + + //批量新增 + public function batchImport(){ + $server_str = str_replace(array("\r\n", "\r", "\n"), "", I('server')); + $server_ar1 = explode(';',$server_str); + array_pop($server_ar1); + $num = count($server_ar1); + if ($num<1) {$this->error('请添加区服数据');} + if($num > 100 ){ + $this->error('区服数量过多,最多只允许添加100个!'); + } + $verify = ['game_id','server_name','time']; + $server_model = D('ServerNotice'); + foreach ($server_ar1 as $key=>$value) { + $arr = explode(',',$value); + foreach ($arr as $k=>$v) { + $att = explode('=',$v); + if(in_array($att[0],$verify)){ + switch ($att[0]){ + case 'time' : + $patten = '/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])(\s+(0[0-9]|1[0-9]|2[0-3])\:(0[0-9]|[1-5][0-9])(\:(0[0-9]|[1-5][0-9]))?)$/'; + if(!strtotime($att[1]) || !preg_match($patten,$att[1])){ + $this->error('开服时间不正确'); + }else{ + $time = $server[$key]['start_time'] = strtotime($att[1]); + } + break; + case 'game_id': + $game = M('Game','tab_')->where('developers = 0')->find($att[1]); + if(empty($game)){ + $this->error('game_id='.$att[1].' 数据错误,请重新上传'); + } + $server[$key]['game_id'] = $att[1]; + break; + default: + $server[$key][$att[0]] = $att[1]; + } + } + } + $server[$key]['game_name'] = get_game_name($server[$key]['game_id']); + $server[$key]['server_num'] = 0; + $server[$key]['recommend_status'] = 1; + $server[$key]['show_status'] = 1; + $server[$key]['stop_status'] = 0; + $server[$key]['server_status'] = 0; + $server[$key]['parent_id'] = 0; + $server[$key]['create_time'] = time(); + $version = get_sdk_version($server[$key]['game_id']); + $server[$key]['server_version'] = empty($version) ? 0 : $version; + + if(!$server_model->create($server[$key])){ + switch ($server_model->getError()) { + case '区服名称不能为空': + $msg = '游戏ID:'.$server[$key]['game_id'].' <'.$server[$key]['server_name'].'> 区服名称不能为空'; + break; + case '区服名称不能超过30个字符': + $msg = '游戏ID:'.$server[$key]['game_id'].' <'.$server[$key]['server_name'].'> 区服名称不能超过30个字符'; + break; + case '同游戏下区服名称已存在': + $msg = '游戏ID:'.$server[$key]['game_id'].' <'.$server[$key]['server_name'].'> 区服名称重复'; + break; + case '开始时间不能为空': + $msg = '游戏ID:'.$server[$key]['game_id'].' <'.$server[$key]['server_name'].'> 开始时间不能为空'; + break; + default: + $msg = "批量添加失败"; + break; + } + $this->error($msg); + } + } + $server = $this->array_unset_tt($server); + $res = M('ServerNotice','tab_')->addAll($server); + if($res !== false){ + $this->success('添加成功!',U('ServerNotice/lists')); + }else{ + $this->error('添加失败!'.M()->getError()); + } + } + + function array_unset_tt($arr){ + //建立一个目标数组 + $res = array(); + foreach ($arr as $key => $value) { + //查看有没有重复项 + if($res[$key-1]['game_id'] == $value['game_id'] && $res[$key-1]['server_name'] == $value['server_name']){ + + $this->error("游戏ID:{$value['game_id']} <{$value['server_name']}> 游戏区服名称重复"); + + //有:销毁 + //unset($arr[$key]); + } + else{ + $res[$key] = $value; + } + } + return $res; + } + + /** + * excel 批量导入游戏区服 + */ + public function batchExcel(){ + $excel = new BatchImportExcelEvent(); + if (empty($_FILES['fileExcel'])) {$this->ajaxReturn(["status"=>0,"info"=>'请选择文件']);exit;} + $info = $excel->uploadExcel($_FILES['fileExcel']); + $data = []; + if(is_array($info)){ + $filename = './Uploads/' . $info['savepath'] . $info['savename']; + $data = $excel->importExcel($filename); + if(is_array($data)){ + $excel->serverDataInsert($data,U('ServerNotice/lists'),true); + }else{ + $this->ajaxReturn(["status"=>0,"info"=>$data]); + } + }else{ + $this->ajaxReturn(["status"=>0,"info"=>$info]); + } + + } + + + + /** + * 区服状态修改 + * @author 鹿文学 + */ + public function change_status($field = null,$value=null) { + $id = array_unique((array)I('ids', 0)); + $id = is_array($id) ? implode(',', $id) : $id; + if (empty($id)) { + $this->error('请选择要操作的数据!'); + } + $map['id'] = array('in', $id); + $servermodel = D(self::model_name); + $server = $servermodel->where($map)->find(); + //开发者区服 + if($server['developers'] > 0){ + $save[$field] = $value; + $result = $servermodel->where($map)->save($save); + }else{ + $result = $servermodel->where($map)->setField($field,$value); + } + $msg = "操作"; + if($result !== false){ + $this->success($msg.'成功'); + }else{ + $this->error($msg.'失败'); + } + } + + + + + +} diff --git a/Application/Admin/Controller/StatController.class.php b/Application/Admin/Controller/StatController.class.php index 325a530f8..163fe452a 100644 --- a/Application/Admin/Controller/StatController.class.php +++ b/Application/Admin/Controller/StatController.class.php @@ -1407,7 +1407,7 @@ class StatController extends ThinkController $model = M('device_statistics','tab_'); if ($type == 0) { - $return = $model->where(['time'=>['neq',0]])->sum('new_device'); + $return = $model->where(array('time'=>array('neq',0)))->sum('new_device'); // $return = $device->all_device(); } else if($type == 1) { $return = $model->where(['time'=>array('between',[$todaystart,$todaystart+86399])])->sum('new_device'); diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index 2a089ff0e..438a28079 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -114,6 +114,7 @@ class TimingController extends AdminController { } + public function caculateTodayDevice() { $start = strtotime(date("Ymd",time())); diff --git a/Application/Admin/Event/BatchImportExcelEvent.class.php b/Application/Admin/Event/BatchImportExcelEvent.class.php index 43d05a584..7ac435222 100644 --- a/Application/Admin/Event/BatchImportExcelEvent.class.php +++ b/Application/Admin/Event/BatchImportExcelEvent.class.php @@ -102,9 +102,15 @@ class BatchImportExcelEvent extends Controller{ /** * 插入区服数据到数据库 + * isnotice 是否是区服预告 */ - public function serverDataInsert($serverData,$url=''){ - $serverModel = new \Admin\Model\ServerModel(); + public function serverDataInsert($serverData,$url='',$isnotice=false){ + if($isnotice){ + $serverModel = new \Admin\Model\ServerNoticeModel(); + }else{ + $serverModel = new \Admin\Model\ServerModel(); + } + $sData = []; $key = 0; foreach($serverData as $server){ diff --git a/Application/Admin/Event/SourceEvent.class.php b/Application/Admin/Event/SourceEvent.class.php index 8627141d9..64c9862bb 100644 --- a/Application/Admin/Event/SourceEvent.class.php +++ b/Application/Admin/Event/SourceEvent.class.php @@ -96,7 +96,6 @@ class SourceEvent extends Controller } } $data['source_version'] = $game_source['source_version'] + 1; - $version = ''; $packageName = ''; if ($data['file_type'] == 1) { diff --git a/Application/Admin/Model/GameModel.class.php b/Application/Admin/Model/GameModel.class.php index a83665f45..7a7afb347 100644 --- a/Application/Admin/Model/GameModel.class.php +++ b/Application/Admin/Model/GameModel.class.php @@ -76,12 +76,12 @@ class GameModel extends Model{ */ public function detail($id,$display_site=''){ /* 获取基础数据 */ - $map['relation_game_id']=$id; + $map['relation_game_id'] = $id; $map['game_status'] = 1; $map['display_site'] = ['like','%'.$display_site.'%']; $info = $this->field(true)->where($map)->group('relation_game_id')->select(); - $info= game_merge($info,$map); - $info=reset($info); + $info = game_merge($info,$map); + $info = reset($info); if(!(is_array($info) || $info['game_status']!=1)){ $this->error = '游戏被禁用或已删除!'; return false; diff --git a/Application/Admin/Model/ServerNoticeModel.class.php b/Application/Admin/Model/ServerNoticeModel.class.php new file mode 100644 index 000000000..cbcf0e3c0 --- /dev/null +++ b/Application/Admin/Model/ServerNoticeModel.class.php @@ -0,0 +1,102 @@ + +// +---------------------------------------------------------------------- + +namespace Admin\Model; +use Think\Model; + +/** + * 文档基础模型 + */ +class ServerNoticeModel extends Model{ + + + + /* 自动验证规则 */ + protected $_validate = array( + array('game_id', '/^[1-9]\d*$/', '请选择游戏', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH), + array('server_name', 'require', '区服名称不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH), + array('server_name', '1,30', '区服名称不能超过30个字符', self::VALUE_VALIDATE, 'length', self::MODEL_BOTH), + array("server_name,game_id,id", 'checkServerName', '同游戏下区服名称已存在', self::MUST_VALIDATE, 'callback', self::MODEL_BOTH), + array('start_time', 'require', '开始时间不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH), + ); + + /* 自动完成规则 */ + protected $_auto = array( + array('create_time', 'getCreateTime', self::MODEL_INSERT,'callback'), + array('server_num', 0, self::MODEL_INSERT), + array('start_time', 'strtotime', self::MODEL_BOTH, 'function'), + array('parent_id', 0,self::MODEL_INSERT,'string'), + ); + + /** + * 构造函数 + * @param string $name 模型名称 + * @param string $tablePrefix 表前缀 + * @param mixed $connection 数据库连接信息 + */ + public function __construct($name = '', $tablePrefix = '', $connection = '') { + /* 设置默认的表前缀 */ + $this->tablePrefix ='tab_'; + /* 执行构造方法 */ + parent::__construct($name, $tablePrefix, $connection); + } + + + + + /** + * 创建时间不写则取当前时间 + * @return int 时间戳 + * @author huajie + */ + protected function getCreateTime(){ + $create_time = I('post.create_time'); + return $create_time?strtotime($create_time):NOW_TIME; + } + + + + /** + * 生成不重复的name标识 + * @author huajie + */ + private function generateName(){ + $str = 'abcdefghijklmnopqrstuvwxyz0123456789'; //源字符串 + $min = 10; + $max = 39; + $name = false; + while (true){ + $length = rand($min, $max); //生成的标识长度 + $name = substr(str_shuffle(substr($str,0,26)), 0, 1); //第一个字母 + $name .= substr(str_shuffle($str), 0, $length); + //检查是否已存在 + $res = $this->getFieldByName($name, 'id'); + if(!$res){ + break; + } + } + return $name; + } + + /** + *判断同游戏下区服名称是否存在 + */ + public function checkServerName($args=null){ + $map['game_id'] = $args['game_id']; + $map['server_name'] = $args['server_name']; + if(empty($args['id'])){ + $data = $this->field('id')->where($map)->find(); + return empty($data); + }else{ + $data = $this->field('id')->where($map)->find(); + return empty($data['id'])?true:$data['id'] == $args['id'] ? true:false; + } + + } +} \ No newline at end of file diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index 2a0dfa5c4..2fe741463 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -95,7 +95,7 @@ @@ -210,7 +210,7 @@ - 游戏详细介绍: + 游戏简介: @@ -251,7 +251,7 @@ - 尺寸不得小于512*512px,圆角半径113px,不强制要求,可直接提供512*512方图 + 尺寸不得小于125*125px,大小不得超过50K @@ -1678,7 +1678,8 @@ } - + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
*游戏名称: + + +
运营平台 + + + + + + + +
*区服名称: + +
显示状态: + + + + +
*开服时间: + +
区服描述: + +
+
+ +
+ + + 返回 + +
+
+ +
+
+ + + + + + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + diff --git a/Application/Admin/View/ServerNotice/batch.html b/Application/Admin/View/ServerNotice/batch.html new file mode 100644 index 000000000..7e5f3038a --- /dev/null +++ b/Application/Admin/View/ServerNotice/batch.html @@ -0,0 +1,168 @@ + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
添加方式: + + + + +
+ + + + + + + + + + + +
Execl模板:下载模板
导入模板
+ + + + + + + + + + +
+
+ + + + 返回 + +
+
+ +
+
+ + + +
+ + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + diff --git a/Application/Admin/View/ServerNotice/edit.html b/Application/Admin/View/ServerNotice/edit.html new file mode 100644 index 000000000..08fda9125 --- /dev/null +++ b/Application/Admin/View/ServerNotice/edit.html @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
*游戏名称: + + +
运营平台: + + + + + + +
*区服名称: + +
显示状态: + + + + + + + + + + +
*开服时间: + +
区服描述: + +
+
+ + +
+ + + 返回 + +
+
+ +
+
+ + + +
+ + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + diff --git a/Application/Admin/View/ServerNotice/lists.html b/Application/Admin/View/ServerNotice/lists.html new file mode 100644 index 000000000..220741070 --- /dev/null +++ b/Application/Admin/View/ServerNotice/lists.html @@ -0,0 +1,354 @@ + + + + + + + + + + + + + +
+
+ +
+ + 新增 + 批量添加 + + 删除 +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+ + - +
+ + +
+
+
+ +
+ +
+ 搜索 +
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 游戏名称区服名称运营平台显示状态开服时间操作
aOh! 暂时还没有内容!
{$data.game_name}{$data.server_name}{:get_systems_name($data['server_version'])} + + {:set_show_time($data['start_time'])} + 编辑 + 删除 +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 开发者账号游戏名称区服名称运营平台显示状态开服时间
aOh! 暂时还没有内容!
{:get_developer_account($data['developers'])}{$data.game_name}{$data.server_name}{:get_systems_name($data['server_version'])} + + {:set_show_time($data['start_time'])}
+
+
+ +
+
+ 导出 + {$_page|default=''} +
+ + + +
+ + + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + diff --git a/Application/Base/Service/GameSourceService.class.php b/Application/Base/Service/GameSourceService.class.php index 4b29cf111..595b13c3b 100644 --- a/Application/Base/Service/GameSourceService.class.php +++ b/Application/Base/Service/GameSourceService.class.php @@ -9,7 +9,7 @@ use GuzzleHttp\Client; class GameSourceService { - const IS_FIXED_IOS13 = true; + const IS_FIXED_IOS13 = false; const DEBUG = true; public function __construct() @@ -92,7 +92,8 @@ class GameSourceService { return false; } - if (self::IS_FIXED_IOS13 && $game['sdk_version'] == 2) { + $isNewSdk = (isset($gameSource['is_new_sdk']) && $gameSource['is_new_sdk'] == 1); + if ($isNewSdk && $game['sdk_version'] == 2) { $channelFolder = $this->getChannelConfigFolder($zip, $packData); return $this->packChannelFolder($zip, $channelFolder); } else { diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index a8d5e1e7c..79fa51a05 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -958,4 +958,54 @@ class PromoteService { return M('promote', 'tab_')->add($data); } + + public function getLandingPageIdentifier($url) + { + $code = $this->getUrlParam($url, 'code'); + if ($code === null) { + $pid = $this->getUrlParam($url, 'gid'); + $gid = $this->getUrlParam($url, 'pid'); + if ($gid === null || $gid === null) { + return null; + } else { + return $gid . '-' . $pid; + } + } + return $code; + } + + public function getDownloadIdentifier($url) + { + $code = $this->getUrlParam($url, 'code'); + if ($code === null) { + $pid = $this->getUrlParam($url, 'game_id'); + $gid = $this->getUrlParam($url, 'promote_id'); + if ($gid === null || $gid === null) { + return null; + } else { + return $gid . '-' . $pid; + } + } + return $code; + } + + private function getUrlParam($url, $name) + { + $items = parse_url($url); + $queryString = ltrim($items['query'], 's='); + $queryString = ltrim($queryString, '/'); + $queryString = rtrim($queryString, '.html'); + $rows = explode('/', $queryString); + $codeIndex = null; + foreach ($rows as $key => $value) { + if ($key >= 3 && $value == $name) { + $codeIndex = $key; + break; + } + } + if ($codeIndex !== null) { + return $rows[$codeIndex + 1] ?? null; + } + return null; + } } \ No newline at end of file diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index c0396423c..c7d4909d2 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -1190,15 +1190,15 @@ function age_verify($cardno, $name) { $date = age($cardno, $name); - if ($date['resp']['code'] == 0 && $date > 0) { + if ($date['status'] == "01") { $age = floor((time() - strtotime($date['data']['birthday'])) / (60 * 60 * 24 * 365)); if ($age > 17) { return 1; } else { return 2; } - } elseif ($date['resp']['code'] != 0 && $date > 0) { - return 0; + } elseif (isset($date['status']) && $date['status'] != '01') { + return $date['status']; } else { return $date; } @@ -1207,13 +1207,14 @@ function age_verify($cardno, $name) //根据配置向接口发送身份证号和姓名进行验证 function age($cardno, $name) { - $host = "http://idcard.market.alicloudapi.com"; - $path = "/lianzhuo/idcard"; + $host = "https://idcardcert.market.alicloudapi.com"; + $path = "/idCardCert"; $method = "GET"; - $appcode = C('tool_age.appcode'); + // $appcode = C('tool_age.appcode'); + $appcode = "244181f0846541a19e24df409736d3b9"; $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); - $querys = "cardno=" . $cardno . "&name=" . $name; + $querys ="idCard={$cardno}&name={$name}"; $bodys = ""; $url = $host . $path . "?" . $querys; $curl = curl_init(); @@ -1222,7 +1223,7 @@ function age($cardno, $name) curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_HEADER, false); if (1 == strpos("$" . $host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); @@ -1231,15 +1232,11 @@ function age($cardno, $name) if (empty($output)) { return -1;//用完 } - if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == '200') { - $headersize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); - $header = substr($output, 0, $headersize); - $body = substr($output, $headersize); - curl_close($curl); - return json_decode($body, true); - } else { - return -2;//失败 - } + + $r = json_decode($output, true); + if ($r['status'] == "02") return 0; + return $r; + } /*短信发送验证限制条件 */ diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index d9104acdd..8b6c93ea7 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1182,13 +1182,20 @@ class DownloadController extends BaseController { } - + if (!empty(I('begtime')) && empty(I('endtime'))) { $map['tab_spend.pay_time'] = ['egt', strtotime(I('begtime'))]; } elseif (empty(I('begtime')) && !empty(I('endtime'))) { $map['tab_spend.pay_time'] = ['elt', strtotime(I('endtime')) + 86399]; } elseif (!empty(I('begtime')) && !empty(I('endtime'))) { $map['tab_spend.pay_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]]; + }else { + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initEndTime = date('Y-m-d'); + $initBegTime = strtotime($initBegTime); + $initEndTime = strtotime($initEndTime); + $map['tab_spend.pay_time'] = ['between',[$initBegTime,$initEndTime]]; } empty(I('relation_game_id')) || $map['tab_game.relation_game_id'] = I('relation_game_id'); @@ -1196,7 +1203,7 @@ class DownloadController extends BaseController { empty(I('server_id')) || $map['tab_spend.server_id'] = I('server_id'); empty(I('game_player_name')) || $map['tab_spend.game_player_name'] = ['like', '%' . I('game_player_name') . '%']; empty(I('user_account')) || $map['tab_spend.user_account'] = ['like', '%' . I('user_account') . '%']; - empty(I('order_number')) || $map['tab_spend.order_number'] = I('order_number'); + empty(I('pay_order_number')) || $map['tab_spend.pay_order_number'] = I('pay_order_number'); $map['tab_spend.pay_status'] = 1; $map['tab_spend.is_check'] = ['neq', 2]; @@ -1218,7 +1225,7 @@ class DownloadController extends BaseController { // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); $this->error('添加下载失败'); } - $this->success('添加下载成功',U('listsIndex')); + $this->success('添加下载成功,导出数据不包含当天',U('listsIndex')); } public function userRecharge_data_export() { @@ -1233,14 +1240,14 @@ class DownloadController extends BaseController { $costBegin = I('cost_begin', ''); //充值总额范围 $costEnd = I('cost_end', ''); $nowTime = date('Y-m-d'); - $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); - $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initBegTime = date('Y-m-d', strtotime('-7 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); $initEndTime = $nowTime; $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); $endTime += 3600 * 24; - + $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; @@ -1618,9 +1625,6 @@ class DownloadController extends BaseController { if (!empty($own_id)) { if (!empty($map['_string'])) { unset($map['_string']); - unset($userPlayInfoWhere['_string']); - unset($userGameLoginWhere['_string']); - unset($spendWhere['_string']); } $map['tab_apply.promote_id'] = $queryPromote['id'];//本账号 @@ -1635,7 +1639,7 @@ class DownloadController extends BaseController { $map["apply_time"] = ["between",[strtotime($begtime1),strtotime($endtime1)]]; } if(!empty($begtime) && !empty($endtime)) { - $map["apply_time"] = ["between",[strtotime($begtime),strtotime($endtime) + 3600 * 24 -1]]; + $map["apply_time"] = ["between",[strtotime($begtime),strtotime($endtime) + 3600 * 24]]; } $serverField = ''; $serverJoin = ''; @@ -1756,26 +1760,59 @@ class DownloadController extends BaseController { public function registerExcelInfo($id,$map) { $xlsName = "注册明细"; $xlsCell = array( - array('account','玩家账号'), - array('promote_account','推广账号'), - array('device_number','设备IMIE/IDFA'), - array('register_time','注册时间'), - array('register_ip','注册ip'), - array('login_time','登陆时间'), - array('login_ip','登陆ip') + '玩家账号', + '推广账号', + '设备IMIE/IDFA', + '注册时间', + '注册ip', + '登陆时间', + '登陆ip' ); $model = M('user','tab_'); - $data = $model->field('account,device_number,promote_account,register_time,register_ip,login_time,login_ip')->where($map)->order('tab_user.id desc')->select(); - $xlsData = []; - foreach ($data as $key1 => $value1) { - $value1['register_time'] = date("Y-m-d H:i:s",$value1['register_time']); - $value1['login_time'] = date("Y-m-d H:i:s",$value1['login_time']); - $value1['account'] = $this->encryption($value1['account']); - $value1['device_number'] = $this->encryption($value1['device_number']); - $xlsData[] = $value1; + $data1 = $model->field('account')->where($map)->order('tab_user.id desc')->select(); + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('gb2312', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + $accessNum = '100000';//从数据库获取总量,假设是十万 + $accessNum = count($data1)?:0 ; + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + for($i = 1; $i <= $pages; $i++) { + $model = M('user','tab_'); + + $data = $model + ->field('account,device_number,promote_account,register_time,register_ip,login_time,login_ip') + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('tab_user.id desc') + ->select(); + foreach($data as $value1) { + $csvData['account'] = $this->encryption($value1['account']); + $csvData['promote_account'] = $value1['promote_account']; + $csvData['device_number'] = $this->encryption($value1['device_number']); + $csvData['register_time'] = date("Y-m-d H:i:s",$value1['register_time']); + $csvData['register_ip'] = $value1['register_ip']; + $csvData['login_time'] = date("Y-m-d H:i:s",$value1['login_time']); + $csvData['login_ip'] = $value1['login_ip']; + mb_convert_variables('GBK', 'UTF-8', $csvData); + fputcsv($fp, $csvData); + } + unset($csvData); + ob_flush(); + flush(); } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); + fclose($fp); + $this->backSuccessExport($id); } //玩家角色excel信息 @@ -1834,12 +1871,12 @@ class DownloadController extends BaseController { $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); $params['begin_time'] = $begTime; - $params['end_time'] = $endTime +3600 * 24 -1; + $params['end_time'] = $endTime -1; if(!empty($map['apply_time'][1])) { $begTime = $map['apply_time'][1][0]; $endTime = $map['apply_time'][1][1]; $params['begin_time'] = $begTime; - $params['end_time'] = $endTime + 3600 * 24 -1; + $params['end_time'] = $endTime -1; unset($map['apply_time']); } if(!empty($map['tab_server.server_id'])) { @@ -2484,72 +2521,141 @@ class DownloadController extends BaseController { public function settlementExcelInfo($id,$map) { $xlsName = "结算明细"; $xlsCell = array( - array('pay_order_number','游戏订单号'), - array('game_name','游戏'), - array('user_account','玩家账号'), - array('promote_account','推广员账号'), - array('pay_amount','订单总额'), - array('pay_amount_zhi','直充'), - array('pay_amount_nei','内充'), - array('selle_ratio','分成比例(直充)'), - array('selle_ratio','分成比例(内充)'), - array('income','收益'), - array('pay_time','充值时间'), - array('selle_status','订单状态'), + '游戏订单号', + '游戏', + '玩家账号', + '推广员账号', + '订单总额', + '直充', + '内充', + '分成比例(直充)', + '分成比例(内充)', + '收益', + '充值时间', + '订单状态', ); $model = M('spend', 'tab_'); $data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') ->where($map) ->order('id desc') - ->select(); + ->select(); + $total = []; + $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income') + ->where($map) + ->find(); + $total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount']; + $total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount']; + $total['income'] = empty($total['income']) ? 0 : $total['income']; + $total['income'] = bcdiv($total['income'], 100, 2); //提现状态 - $withdrawIds = []; - foreach ($data as $key => $value) { - if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) { - $withdrawIds[] = $value['withdraw_id']; - } - } - if(empty($withdrawIds)) { - $withdrawIds = "-10000"; - } - $withdrawStatus = M('withdraw', 'tab_') - ->where(array('id' => ['in',$withdrawIds])) - ->getField('id,status'); + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('gb2312', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + $accessNum = count($data)?:0 ; - foreach ($data as &$list) { - //提现状态 - $list['pay_order_number'] = $this->encryption($list['pay_order_number']); - $list['user_account'] = $this->encryption($list['user_account']); - if ($list['pay_status'] == 1) { - switch ($list['selle_status']) { - case 0: - $list['selle_status'] = '未提现'; - break; - default: - if ($list['withdraw_id'] > 0) { - $list['selle_status'] = FinanceController::$withdrawStatus[$withdrawStatus[$list['withdraw_id']]]; - } else { - $list['selle_status'] = ''; - } - break; + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + for($i = 1; $i <= $pages; $i++) { + + $data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') + ->where($map) + ->order('id desc') + ->limit(($i-1)*$perSize ,$perSize) + ->select(); + $withdrawIds = []; + foreach ($data as $key => $value) { + if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) { + $withdrawIds[] = $value['withdraw_id']; } - } else { - $list['selle_status'] = '支付失败'; } - - $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); - $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); - if($list['pay_way'] == -1) { - $list['pay_amount_zhi'] = 0; - $list['pay_amount_nei'] = $list['pay_amount']; - }else { - $list['pay_amount_zhi'] = $list['pay_amount']; - $list['pay_amount_nei'] = 0; + if(empty($withdrawIds)) { + $withdrawIds = "-10000"; } - } + $withdrawStatus = M('withdraw', 'tab_') + ->where(array('id' => ['in',$withdrawIds])) + ->getField('id,status'); + + foreach ($data as &$list) { + //提现状态 + $list['pay_order_number'] = $this->encryption($list['pay_order_number']); + $list['user_account'] = $this->encryption($list['user_account']); + if ($list['pay_status'] == 1) { + switch ($list['selle_status']) { + case 0: + $list['selle_status'] = '未提现'; + break; + default: + if ($list['withdraw_id'] > 0) { + $list['selle_status'] = FinanceController::$withdrawStatus[$withdrawStatus[$list['withdraw_id']]]; + } else { + $list['selle_status'] = ''; + } + break; + } + } else { + $list['selle_status'] = '支付失败'; + } + + $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); + $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); + if($list['pay_way'] == -1) { + $list['pay_amount_zhi'] = 0; + $list['pay_amount_nei'] = $list['pay_amount']; + }else { + $list['pay_amount_zhi'] = $list['pay_amount']; + $list['pay_amount_nei'] = 0; + } + + + $csvData["pay_order_number"] = $list["pay_order_number"]; + $csvData["game_name"] = $list["game_name"]; + $csvData["user_account"] = $list["user_account"]; + $csvData["promote_account"] = $list["promote_account"]; + $csvData["pay_amount"] = $list["pay_amount"]; + $csvData["pay_amount_zhi"] = $list["pay_amount_zhi"]; + $csvData["pay_amount_nei"] = $list["pay_amount_nei"]; + $csvData["selle_ratio"] = $list["selle_ratio"]; + $csvData["selle_ratio1"] = $list["selle_ratio"]; + $csvData["income"] = $list["income"]; + $csvData["pay_time"] = $list["pay_time"]; + $csvData["selle_status"] = $list["selle_status"]; + mb_convert_variables('GBK', 'UTF-8', $csvData); + fputcsv($fp, $csvData); + $xlsData[] = $csvData; + } + unset($xlsData); + ob_flush(); + flush(); + } + $allData['pay_order_number'] = '合计'; + $allData['game_name'] = '--'; + $allData['user_account'] = '--'; + $allData['promote_account'] = '--'; + $allData['pay_amount'] = $total['pay_amount']; + $allData['pay_amount_zhi'] = $total['direct_pay_amount']; + $allData['pay_amount_nei'] = $total['inner_pay_amount']; + $allData['selle_ratio'] = '--'; + $allData['selle_ratio1'] = '--'; + $allData['income'] = $total['income']; + $allData['pay_time'] = '--'; + $allData['selle_status'] = '--'; + mb_convert_variables('GBK', 'UTF-8', $allData); + fputcsv($fp, $allData); + $xlsData[] = $allData; + fclose($fp); + + $this->backSuccessExport($id); + - $xlsData = $data; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); + // $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); } @@ -2663,7 +2769,20 @@ class DownloadController extends BaseController { $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 $params['pay_way'] = -1; $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 - + $allData['role_num'] = 0; + $allData['user_num'] = 0; + $allData['new_user_num'] = 0; + $allData['new_device_num'] = 0; + $allData['new_ip_num'] = 0; + $allData['login_user_num'] = 0; + $allData['spend_user_num'] = 0; + $allData['spend_num'] = 0; + $allData['spend_all_amount'] = 0; + $allData['spend_cash'] = 0; + $allData['spend_generic'] = 0; + $allData['spend_binding'] = 0; + $allData['spend_discount'] = 0; + $allData['spend_voucher'] = 0; foreach ($params['dayList'] as $day) { $date = date('Ymd', strtotime($day)); $records[] = [ @@ -2683,12 +2802,29 @@ class DownloadController extends BaseController { 'spend_discount' => 0, 'spend_voucher' => 0, ]; - + $allData['role_num'] += $roleNumList[$day]; + $allData['user_num'] += $userNumList[$day]; + $allData['new_user_num'] += $newUserNumList[$day]; + $allData['new_device_num'] += $newDeviceNumList[$day]; + $allData['new_ip_num'] += $newIpNumList[$day]; + $allData['login_user_num'] += $loginUserNumList[$day]; + $allData['spend_user_num'] += $spendUserNumList[$day]; + $allData['spend_num'] += $spendNumList[$day]; + $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); + $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); + $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); + $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); + $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); + $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); + } + $allData['day'] = '合计'; + $records[] = $allData; $xlsData = []; foreach ($records as $key1 => $value1) { $xlsData[] = $value1; } + $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); } @@ -2819,18 +2955,18 @@ class DownloadController extends BaseController { public function userRechargeExcelInfo($id,$map) { $xlsName = "充值玩家"; $xlsCell = array( - array('user_account','玩家账号'), - array('game_name','游戏名称'), - array('server_name','游戏区服'), - array('sdk_version','平台'), - array('role_name','角色名'), - array('role_level','等级'), - array('recharge_cost','充值总额'), - array('recharge_count','充值次数'), - array('recharge_cost_today','昨日充值'), - array('unlogin_day','未登录天数'), - array('play_time','最后登录时间'), - array('promote_account','推广员账号'), + '玩家账号', + '游戏名称', + '游戏区服', + '平台', + '角色名', + '等级', + '充值总额', + '充值次数', + '昨日充值', + '未登录天数', + '最后登录时间', + '推广员账号', ); $subMap = []; @@ -2879,55 +3015,96 @@ class DownloadController extends BaseController { ->buildSql(); $map['_string'] = 'ui.role_id in (' . $subQuery . ')'; } - $map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; + $secondDay = 24*3600 + 1; + $map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - $secondDay]]; unset($map['begintime']); unset($map['endtime']); //$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id'; + $fieldUC = "sum(uc.recharge_cost) recharge_cost,sum(uc.recharge_count) recharge_count,sum(if(uc.create_time = {$nowTime},uc.recharge_cost,0)) as recharge_cost_today"; $fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version"; $field = $fieldUC . ',' . $fieldUI; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) - ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->join('left join tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') ->where($map) ->group('uc.role_id,uc.server_id,uc.game_id') ->buildSql(); $roles = M()->alias('record') ->table($subQuery) ->select(); - foreach ($roles as $role) { - $records[] = [ - 'user_account' => encryption($role['user_account']), - 'game_name' => $role['game_name'], - 'role_name' => $role['role_name'], - 'role_id' => $role['role_id'], - 'role_level' => $role['role_level'], - 'server_id' => $role['server_id'], - 'server_name' => $role['server_name'], - 'recharge_cost' => empty($role['recharge_cost']) ? 0 : $role['recharge_cost'], - 'recharge_count' => empty($role['recharge_count']) ? 0 : $role['recharge_count'], - 'recharge_cost_today' => empty($role['recharge_cost_today']) ? 0 : $role['recharge_cost_today'], - 'play_time' => $role['play_time'], - 'play_ip' => $role['play_ip'], - 'promote_id' => $role['promote_id'], - 'promote_account' => $role['promote_account'], - 'sdk_version' => $role['sdk_version'], - 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) - ]; - } + $total = []; + $total = M('user_play_data_count', 'tab_')->alias('uc') + ->field($fieldUC) + ->join('left join tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->where($map) + ->find(); + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('gb2312', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + $accessNum = '100000';//从数据库获取总量,假设是十万 + $accessNum = count($roles)?:0 ; - $xlsData = []; - foreach ($records as $key1 => $value1) { - $value1['user_account'] = $this->encryption($value1['user_account']); - $value1['play_time'] = date('Y-m-d H:i:s',$value1['play_time']); - if($value1['sdk_version'] == 1) { - $value1['sdk_version'] = "Android"; - }else { - $value1['sdk_version'] = "ios"; - } - $xlsData[] = $value1; - } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + for($i = 1; $i <= $pages; $i++) { + $data = M()->alias('record') + ->table($subQuery) + ->limit(($i-1)*$perSize ,$perSize) + ->select(); + foreach($data as $key => $value) { + $csvData['user_account'] = empty($value['user_account']) ? '--' : encryption($value['user_account']); + $csvData['game_name'] = empty($value['game_name']) ? '--' :$value['game_name']; + $csvData['server_name'] = empty($value['server_name']) ? '--' :$value['server_name']; + if($value['sdk_version'] == 1) { + $csvData['sdk_version'] = "Android"; + }else if($value['sdk_version'] == 2) { + $csvData['sdk_version'] = "ios"; + } else { + $csvData['sdk_version'] = "--"; + } + $csvData['role_name'] = empty($value['role_name']) ? '--' :$value['role_name']; + $csvData['role_level'] = empty($value['role_level']) ? '--' :$value['role_level']; + $csvData['recharge_cost'] = empty($value['recharge_cost']) ? 0 : $value['recharge_cost']; + $csvData['recharge_count'] = empty($value['recharge_count']) ? 0 : $value['recharge_count']; + $csvData['recharge_cost_today'] = empty($value['recharge_cost_today']) ? 0 : $value['recharge_cost_today']; + $csvData['unlogin_day'] = empty($value['play_time']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $value['play_time']))) / (24 * 3600)); + $csvData['play_time'] = empty($value['play_time']) ? '--' :date('Y-m-d H:i:s',$value['play_time']); + $csvData['promote_account'] = empty($value['promote_account']) ? '--' :$value['promote_account']; + + mb_convert_variables('GBK', 'UTF-8', $csvData); + fputcsv($fp, $csvData); + $xlsData[] = $csvData; + } + unset($xlsData); + ob_flush(); + flush(); + } + $allData['user_account'] = '合计'; + $allData['game_name'] = '--'; + $allData['server_name'] = '--'; + $allData['sdk_version'] = '--'; + $allData['role_name'] = '--'; + $allData['role_level'] = '--'; + $allData['recharge_cost'] = $total['recharge_cost']; + $allData['recharge_count'] = $total['recharge_count']; + $allData['recharge_cost_today'] = $total['recharge_cost_today']; + $allData['unlogin_day'] = '--'; + $allData['play_time'] = '--'; + $allData['promote_account'] = '--'; + mb_convert_variables('GBK', 'UTF-8', $allData); + fputcsv($fp, $allData); + $xlsData[] = $allData; + fclose($fp); + $this->backSuccessExport($id); } public function rechargeExcelInfo($id,$map) { @@ -2969,66 +3146,111 @@ class DownloadController extends BaseController { $perSize = 5000;//每次查询的条数 $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $model = M('spend','tab_'); - $data = $model - ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain') - ->join('tab_game on tab_spend.game_id = tab_game.id') - ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') - ->where($map) - ->limit(($i-1)*$perSize ,$perSize) - ->order('tab_spend.id desc') - ->select(); - foreach ($data as $key1 => $value1) { - $value1['pay_way'] = $this->payWay[$value1['pay_way']]; - $value1['pay_time'] = date('Y-m-d H:i:s',$value1['pay_time']); - $value1['p_p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; - $value1['p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; - $value1['proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; - // $value1['user_account'] = substr_replace($value1['user_account'],'************',3,12); - $value1['user_account'] = $this->encryption($value1['user_account']); - $value1['order_number'] = $this->encryption($value1['order_number']); - if(!empty($value1['chain'])) { - $chain = trim($value1['chain'],'/'); - $chainArr = explode('/', $chain); - if(!empty($chainArr[1])) { - $thisPromoteData1 = D('Promote') - ->field('account,real_name') - ->where(array('id' => $chainArr[1])) - ->find(); - $value1['p_p_proinfo'] = $thisPromoteData1['account'].'('.$thisPromoteData1['real_name'].')'; //部门长 - } - if(!empty($chainArr[2])) { - $thisPromoteData2 = D('Promote') - ->field('account,real_name') - ->where(array('id' => $chainArr[2])) - ->find(); - $value1['p_proinfo'] = $thisPromoteData2['account'].'('.$thisPromoteData2['real_name'].')'; //组长 - } - - - } - $csvData["user_account"] = $value1["user_account"]; - $csvData["order_number"] = $value1["order_number"]; - $csvData["pay_amount"] = $value1["pay_amount"]; - $csvData["pay_way"] = $value1["pay_way"]; - $csvData["game_name"] = $value1["game_name"]; - $csvData["server_name"] = $value1["server_name"]; - $csvData["game_player_name"] = $value1["game_player_name"]; - $csvData["p_p_proinfo"] = $value1["p_p_proinfo"]; - $csvData["p_proinfo"] = $value1["p_proinfo"]; - $csvData["proinfo"] = $value1["proinfo"]; - $csvData["pay_time"] = $value1["pay_time"]; - mb_convert_variables('GBK', 'UTF-8', $csvData); - fputcsv($fp, $csvData); - $xlsData[] = $csvData; - } - unset($xlsData); - ob_flush(); - flush(); - } - fclose($fp); - $this->backSuccessExport($id); + $promoteIdData = []; + $promoteData = []; + for($i = 1; $i <= $pages; $i++) { + $model = M('spend','tab_'); + $data = $model + ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain,tab_promote.level,tab_promote.parent_id') + ->join('tab_game on tab_spend.game_id = tab_game.id') + ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('tab_spend.id desc') + ->select(); + foreach ($data as $list) { + switch ($list['level']) { + case 3: + $promoteIdData[] = $list['parent_id']; + break; + case 4: + $promoteIdData[] = $list['parent_id']; + $chain = trim($list['chain'], '/'); + $chainArr = explode('/', $chain); + $promoteIdData[] = $chainArr[1]; + break; + } + } + if (!empty($promoteIdData)) { + $promoteIdData = array_unique($promoteIdData); + $promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name'); + } + foreach ($data as $key1 => $value1) { + $value1['pay_way'] = $this->payWay[$value1['pay_way']]; + $value1['pay_time'] = date('Y-m-d H:i:s',$value1['pay_time']); + $value1['p_p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; + $value1['p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; + $value1['proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; + // $value1['user_account'] = substr_replace($value1['user_account'],'************',3,12); + $value1['user_account'] = $this->encryption($value1['user_account']); + $value1['pay_order_number'] = $this->encryption($value1['pay_order_number']); + switch ($value1['level']) { + case 3: + $value1['p_p_pro_account'] = $promoteData[$value1['parent_id']]['account']; + $value1['p_p_pro_real_name'] = $promoteData[$value1['parent_id']]['real_name']; + $value1['p_pro_account'] = $value1['pro_account']; + $value1['p_pro_real_name'] = $value1['pro_real_name']; + break; + case 4: + $promoteIdData[] = $value1['parent_id']; + $chain = trim($value1['chain'], '/'); + $chainArr = explode('/', $chain); + $value1['p_p_pro_account'] = $promoteData[$chainArr[1]]['account']; + $value1['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name']; + $value1['p_pro_account'] = $promoteData[$value1['parent_id']]['account']; + $value1['p_pro_real_name'] = $promoteData[$value1['parent_id']]['real_name']; + break; + } + $value1['p_p_proinfo'] = $value1['p_p_pro_account'].'('.$value1['p_p_pro_real_name'].')'; //部门长 + $value1['p_proinfo'] = $value1['p_pro_account'].'('.$value1['p_pro_real_name'].')'; //组长 + unset($value1['p_p_pro_account']); + unset($value1['p_p_pro_real_name']); + unset($value1['p_pro_account']); + unset($value1['p_pro_real_name']); + + $csvData["user_account"] = $value1["user_account"]; + $csvData["pay_order_number"] = $value1["pay_order_number"]; + $csvData["pay_amount"] = $value1["pay_amount"]; + $csvData["pay_way"] = $value1["pay_way"]; + $csvData["game_name"] = $value1["game_name"]; + $csvData["server_name"] = $value1["server_name"]; + $csvData["game_player_name"] = $value1["game_player_name"]; + $csvData["p_p_proinfo"] = $value1["p_p_proinfo"]; + $csvData["p_proinfo"] = $value1["p_proinfo"]; + $csvData["proinfo"] = $value1["proinfo"]; + $csvData["pay_time"] = $value1["pay_time"]; + mb_convert_variables('GBK', 'UTF-8', $csvData); + fputcsv($fp, $csvData); + $xlsData[] = $csvData; + } + unset($xlsData); + ob_flush(); + flush(); + } + $income = '0.00'; + $income = M('Spend', 'tab_') + ->field('sum(tab_spend.pay_amount) as income') + ->join('tab_game on tab_spend.game_id = tab_game.id') + ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') + ->where($map) + ->order('tab_spend.id desc') + ->find()['income']; + $csvData1["user_account"] = "合计"; + $csvData1["pay_order_number"] = "--"; + $csvData1["pay_amount"] = $income; + $csvData1["pay_way"] = "--"; + $csvData1["game_name"] = "--"; + $csvData1["server_name"] = "--"; + $csvData1["game_player_name"] = "--"; + $csvData1["p_p_proinfo"] = "--"; + $csvData1["p_proinfo"] = "--"; + $csvData1["proinfo"] = "--"; + $csvData1["pay_time"] = "--"; + mb_convert_variables('GBK', 'UTF-8', $csvData1); + fputcsv($fp, $csvData1); + $xlsData[] = $csvData1; + fclose($fp); + $this->backSuccessExport($id); } public function backSuccessExport($id) { //导出成功后 diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index f8b4e8ceb..c0c245b2e 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -182,6 +182,7 @@ class FinanceController extends BaseController $parameter['endtime'] = $initEndTime; $data = []; + $total = []; $count = 0; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $withdrawIds = []; @@ -222,6 +223,13 @@ class FinanceController extends BaseController ->page($page, $row) ->select(); $count = $model->where($map)->count(); + $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income') + ->where($map) + ->find(); + $total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount']; + $total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount']; + $total['income'] = empty($total['income']) ? 0 : $total['income']; + $total['income'] = bcdiv($total['income'], 100, 2); //提现状态 if (empty($withdrawIds)) { @@ -264,6 +272,7 @@ class FinanceController extends BaseController $this->assign('listData', $data); $this->assign('count', $count); + $this->assign('total', $total); $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('_page', $page); diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index fddae1396..07d67af4e 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -142,8 +142,9 @@ class HomeController extends Controller $this->error('访问错误'); } - $blackList = M('device_bans', 'tab_')->where(['type' => 3])->getField('tag', true); - if (in_array($code, $blackList) || in_array('gid/' . $gameId . '/pid/' . $promoteId, $blackList)) { + $identifier = $code != '' ? $code : 'gid/' . $gameId . '/pid/' . $promoteId; + $isBlack = M('device_bans', 'tab_')->where(['type' => 3, 'tag' => ['like', '%' . $identifier . '%']])->limit(1)->getField('id'); + if ($isBlack) { $this->error('该链接已被禁'); } @@ -197,7 +198,7 @@ class HomeController extends Controller ->find(); $game['icon'] = get_cover($game['icon'], 'path'); - $gameSource = M('GameSource', 'tab_')->field(['create_time', 'org_plist_url'])->where(array('game_id' => $game['id']))->find(); + $gameSource = M('GameSource', 'tab_')->field(['create_time', 'org_plist_url', 'is_new_sdk'])->where(array('game_id' => $game['id']))->find(); $imageIds = explode(',', $game['flooring_page_imgs']) ?? []; $imageUrls = []; @@ -207,9 +208,9 @@ class HomeController extends Controller $game['flooring_page_imgs'] = $imageUrls; $isNewIos = false; - /* if ($gameSource['create_time'] > strtotime(date('2019-11-27 00:00:00'))) { + if ($gameSource['is_new_sdk'] == 1) { $isNewIos = true; - } */ + } $downloadUrl = ''; if (!$isNewIos && $isIOS13) { @@ -230,7 +231,30 @@ class HomeController extends Controller $this->assign('promoteId', $promoteId); $cur_url = base64_encode(base64_encode("http://" . $_SERVER['HTTP_HOST'] . __SELF__)); $this->assign('cur_url', $cur_url); - $this->display('landingPage'); + if ($this->get_device_type() == 'ios') { + $this->display('landingPage'); + } else { + $this->display('landingPage2'); + } + + } + + private function get_device_type() + { + //全部变成小写字母 + $agent = strtolower($_SERVER['HTTP_USER_AGENT']); + $type = 'other'; + //分别进行判断 + if(strpos($agent, 'iphone') || strpos($agent, 'ipad')) + { + $type = 'ios'; + } + + if(strpos($agent, 'android')) + { + $type = 'android'; + } + return $type; } diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 580cc849d..830606409 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -35,8 +35,9 @@ class PackageController extends Controller $this->redirect("package/downloadError", ['message' => '访问错误']); } - $blackList = M('device_bans', 'tab_')->where(['type' => 4])->getField('tag', true); - if (in_array($code, $blackList) || in_array('game_id/' . $gameId . '/promote_id/' . $promoteId, $blackList)) { + $identifier = $code != '' ? $code : 'game_id/' . $gameId . '/promote_id/' . $promoteId; + $isBlack = M('device_bans', 'tab_')->where(['type' => 4, 'tag' => ['like', '%' . $identifier . '%']])->limit(1)->getField('id'); + if ($isBlack) { $this->redirect("package/downloadError", ['message' => '该链接已被禁']); } if ($code != '') { diff --git a/Application/Home/Controller/PromoteCoinController.class.php b/Application/Home/Controller/PromoteCoinController.class.php index 9a6ba8d00..a9dcc566c 100644 --- a/Application/Home/Controller/PromoteCoinController.class.php +++ b/Application/Home/Controller/PromoteCoinController.class.php @@ -424,7 +424,7 @@ class PromoteCoinController extends BaseController $targetAccount = isset($promotes[$log['target_id']]) ? $promotes[$log['target_id']]['account'] : '未知推广账号'; } if ($log['target_type'] == 2) { - $targetAccount = isset($promotes[$log['target_id']]) ? $promotes[$log['target_id']]['account'] : '未知玩家'; + $targetAccount = isset($users[$log['target_id']]) ? $users[$log['target_id']]['account'] : '未知玩家'; } $records[] = [ 'id' => $log['id'], diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index f505a8857..7be4e73b6 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -100,7 +100,7 @@ class PromoteController extends BaseController $today_start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $today_end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; - $today_open_server_list = M("server as sv", "tab_") + $today_open_server_list = M("ServerNotice as sv", "tab_") ->where( array("sv.start_time" => array("BETWEEN", array($today_start, $today_end)), "sv.show_status" => 1)) @@ -110,7 +110,7 @@ class PromoteController extends BaseController ->page(1, 20) ->select(); - $count = M("server", "tab_") + $count = M("ServerNotice", "tab_") ->where( array("start_time" => array("BETWEEN", array($today_start, $today_end)), "show_status" => 1)) @@ -240,121 +240,79 @@ class PromoteController extends BaseController private function caculateSpend($pay_time, $condition, $create = [], $type = 0) { - $map1['promote_id'] = $map['promote_id'] = array('egt', 0); + $map['promote_id'] = array('egt', 0); $spend = M('Spend', 'tab_'); - $map1['pay_status'] = $map['pay_status'] = 1; + $map['pay_status'] = 1; $today = total(1); $yesterday = total(5); $week = total(2); $mounth = total(3); - unset( $map['create_time']); - - $promote_id = get_pid(); - - $promoteId = M("promote", "tab_") - ->field("id") - ->where(array('chain' => ['like', '/'.$promote_id . '/%'],'id'=>$promote_id,'_logic'=>'or')) - ->select(); - $promoteId = implode(',',array_column($promoteId,'id')); - - $whereUser['promote_id'] = ['IN', $promoteId]; - - if ($type == 1) { - $pay_time = total(1); - $start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); - $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; - $whereUser['register_time'] = ['between', array($start, $end - 1)]; - $userId = M('user', 'tab_')->field('id')->where($whereUser)->select(); - - } else if ($type == 2) { - $pay_time = total(3); - $start = mktime(0, 0, 0, date('m'), 1, date('Y')); - $end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1; + $this->getLoginPromote(); + + $promoteId = $this->loginPromote['id']; + + $promoteIds = M("promote", "tab_") + ->where(array('chain' => ['like', $this->loginPromote['chain'] . $promoteId . '/%'])) + ->getField('id', true); + $promoteIds[] = $promoteId; + + $map['promote_id'] = ['IN', $promoteIds]; + if (in_array($type, [1, 2])) { + $whereUser['promote_id'] = $map['promote_id']; + if ($type == 1) { + $pay_time = total(1); + $start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); + $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; + } else { + $pay_time = total(3); + $start = mktime(0, 0, 0, date('m'), 1, date('Y')); + $end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1; + } $whereUser['register_time'] = ['between', array($start, $end - 1)]; - $userId = M('user', 'tab_')->field('id')->where($whereUser)->select(); - } -// if ($userId) { -// var_dump($userId); -// } - - if ($userId) { + $userId = M('user', 'tab_')->where($whereUser)->getField('id', true); - $userId = implode(',', array_column($userId, 'id')); -// var_dump($userId); - $map1['user_id'] = $map['user_id'] = ['IN', $userId]; - } else if (!$userId && $type != 0) { - return array('sum_mounth' => 0, 'sum_today' => 0); + if ($userId) { + $map['user_id'] = ['IN', $userId]; + } else if (!$userId && $type != 0) { + return array('sum_mounth' => 0, 'sum_today' => 0); + } } - //获取所有会长 - $promote_map = "`chain` = '%/{$promote_id}/%' OR id = {$promote_id}"; - - $promote = M("promote","tab_")->field("id,account")->where($promote_map)->select(); - $data =array(); - for ($i=0; $i < count($promote); $i++) { - # code... - $proid = M("promote","tab_")->field("id")->where("`chain` like '%/{$promote[$i]['id']}/%'")->select(); - $str = ''; - for($k=0; $kfield(' - floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count, - floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today, + $data = $spend + ->field(' + floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as sum_count, + floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as sum_today, floor(sum(IF(pay_time ' . $yesterday . ',pay_amount,0))*100) as yesterday, - floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week, - floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth') - ->where($map) - ->where("pay_time".$pay_time) - ->find(); - $dbdata['promote_account'] = $promote[$i]['account']; - } else { - $dbdata = $spend - ->field(' - floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count, - floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today, + floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as sum_week, + floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as sum_mounth') + ->where($map) + ->where("pay_time".$pay_time) + ->find(); + } else { + $data = $spend + ->field(' + floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as sum_count, + floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as sum_today, floor(sum(IF(pay_time ' . $yesterday . ',pay_amount,0))*100) as yesterday, - floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week, - floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth') - ->where($map) - ->where("pay_time".$pay_time) - ->find(); - $dbdata['promote_account'] = $promote[$i]['account']; - } - $data[] = $dbdata; - } -// if ($userId) { -// echo $spend->_sql();die(); -// } - foreach ($data as $key => $value) { - $value['count'] ?: 0; - $value['today'] ?: 0; - $value['week'] ?: 0; - $value['mounth'] ?: 0; - static $i = 0; - $i++; - $data[$key]['rand'] = $i; - $data[$key]['count'] = $value['count'] / 100; - $data[$key]['today'] = $value['today'] / 100; - $data[$key]['yesterday'] = $value['yesterday'] / 100; - $data[$key]['week'] = $value['week'] / 100; - $data[$key]['mounth'] = $value['mounth'] / 100; - } - $total = $this->data_total($data); - - return $total; -// + floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as sum_week, + floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as sum_mounth') + ->where($map) + ->where("pay_time".$pay_time) + ->find(); + } + $data['sum_count'] = empty($data['sum_count']) ? 0 : bcdiv($data['sum_count'], 100 ,2); + $data['sum_today'] = empty($data['sum_today']) ? 0 : bcdiv($data['sum_today'], 100 ,2); + $data['yesterday'] = empty($data['yesterday']) ? 0 : bcdiv($data['yesterday'], 100 ,2); + $data['sum_week'] = empty($data['sum_week']) ? 0 : bcdiv($data['sum_week'], 100 ,2); + $data['sum_mounth'] = empty($data['sum_mounth']) ? 0 : bcdiv($data['sum_mounth'], 100 ,2); + return $data; } public function data_total($data) @@ -484,7 +442,7 @@ class PromoteController extends BaseController $map['sv.show_status'] = 1; $count_map['show_status'] = 1; - $open_server_list = M("server as sv", "tab_") + $open_server_list = M("ServerNotice as sv", "tab_") ->where($map) ->join("left join tab_game gm on gm.id=sv.game_id") ->field('sv.*,gm.icon') @@ -492,7 +450,7 @@ class PromoteController extends BaseController ->page($pg, 20) ->select(); - $count = M("server", "tab_") + $count = M("ServerNotice", "tab_") ->where($count_map) ->count(); //var_dump($count); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 908a5c82e..d928c9914 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -32,7 +32,7 @@ class QueryController extends BaseController $serverId = trim(I('server_id', '')); $gamePlayerName = trim(I('game_player_name', '')); $userAccount = trim(I('user_account', '')); - $orderNumber = trim(I('order_number', '')); + $payOrderNumber = trim(I('pay_order_number', '')); $nowTime = date('Y-m-d'); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); @@ -71,8 +71,8 @@ class QueryController extends BaseController if (!empty($userAccount)) { $map['tab_spend.user_account'] = $userAccount; } - if (!empty($orderNumber)) { - $map['tab_spend.order_number'] = $orderNumber; + if (!empty($payOrderNumber)) { + $map['tab_spend.pay_order_number'] = $payOrderNumber; } if (isset($_REQUEST['pay_way']) && $_REQUEST['pay_way'] !== '') { $payWay = intval(I('pay_way')); @@ -91,9 +91,10 @@ class QueryController extends BaseController $data = []; $count = 0; + $income = '0.00'; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $data = M('Spend', 'tab_') - ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain') + ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain,tab_promote.level,tab_promote.parent_id') ->join('tab_game on tab_spend.game_id = tab_game.id') ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') ->where($map) @@ -105,39 +106,64 @@ class QueryController extends BaseController ->join('tab_game on tab_spend.game_id = tab_game.id') ->where($map) ->count(); + + $income = M('Spend', 'tab_') + ->field('sum(tab_spend.pay_amount) as income') + ->join('tab_game on tab_spend.game_id = tab_game.id') + ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') + ->where($map) + ->order('tab_spend.id desc') + ->find()['income']; } if (!empty($data)) { + $promoteIdData = []; + foreach ($data as $list) { + switch ($list['level']) { + case 3: + $promoteIdData[] = $list['parent_id']; + break; + case 4: + $promoteIdData[] = $list['parent_id']; + $chain = trim($list['chain'], '/'); + $chainArr = explode('/', $chain); + $promoteIdData[] = $chainArr[1]; + break; + } + } + $promoteData = []; + if (!empty($promoteIdData)) { + $promoteIdData = array_unique($promoteIdData); + $promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name'); + } foreach ($data as &$list) { - $list['p_p_pro_account'] = $list['pro_account']; - $list['p_p_pro_real_name'] = $list['pro_real_name']; - $list['p_pro_account'] = $list['pro_account']; - $list['p_pro_real_name'] = $list['pro_real_name']; - if (!empty($list['chain'])) { - $chain = trim($list['chain'], '/'); - $chainArr = explode('/', $chain); - if (!empty($chainArr[1])) { - $thisPromoteData1 = D('Promote') - ->field('account,real_name') - ->where(array('id' => $chainArr[1])) - ->find(); - $list['p_p_pro_account'] = $thisPromoteData1['account']; //部门长 - $list['p_p_pro_real_name'] = $thisPromoteData1['real_name']; - } - if (!empty($chainArr[2])) { - $thisPromoteData2 = D('Promote') - ->field('account,real_name') - ->where(array('id' => $chainArr[2])) - ->find(); - $list['p_pro_account'] = $thisPromoteData2['account']; //组长 - $list['p_pro_real_name'] = $thisPromoteData2['real_name']; - } - - + switch ($list['level']) { + case 1: + case 2: + $list['p_p_pro_account'] = $list['pro_account']; + $list['p_p_pro_real_name'] = $list['pro_real_name']; + $list['p_pro_account'] = $list['pro_account']; + $list['p_pro_real_name'] = $list['pro_real_name']; + break; + case 3: + $list['p_p_pro_account'] = $promoteData[$list['parent_id']]['account']; + $list['p_p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name']; + $list['p_pro_account'] = $list['pro_account']; + $list['p_pro_real_name'] = $list['pro_real_name']; + break; + case 4: + $promoteIdData[] = $list['parent_id']; + $chain = trim($list['chain'], '/'); + $chainArr = explode('/', $chain); + $list['p_p_pro_account'] = $promoteData[$chainArr[1]]['account']; + $list['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name']; + $list['p_pro_account'] = $promoteData[$list['parent_id']]['account']; + $list['p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name']; + break; } $list['user_account'] = substr($list['user_account'], 0, 2) . '******' . substr($list['user_account'], 8); //订单隐藏算法 - $orderLen = strlen($list['order_number']); + $orderLen = strlen($list['pay_order_number']); $strLen = 4; $hideChar = ''; @@ -149,7 +175,7 @@ class QueryController extends BaseController $hideChar .= '*'; } - $list['order_number'] = substr($list['order_number'], 0, $strLen) . $hideChar . substr($list['order_number'], $orderLen - $strLen); + $list['pay_order_number'] = substr($list['pay_order_number'], 0, $strLen) . $hideChar . substr($list['pay_order_number'], $orderLen - $strLen); } } @@ -163,7 +189,7 @@ class QueryController extends BaseController $parameter['server_id'] = $serverId; $parameter['game_player_name'] = $gamePlayerName; $parameter['user_account'] = $userAccount; - $parameter['order_number'] = $orderNumber; + $parameter['pay_order_number'] = $payOrderNumber; $parameter['own_id'] = $ownId; $parameter['level_promote_2'] = $levelPromote[0]; $parameter['level_promote_3'] = $levelPromote[1]; @@ -177,6 +203,7 @@ class QueryController extends BaseController } $this->assign('listData', $data); $this->assign('count', $count); + $this->assign('income', $income); $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('setdate', date("Y-m-d")); @@ -1736,6 +1763,7 @@ class QueryController extends BaseController $records = []; $pagination = ''; $count = 0; + $total = []; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; $ids = M('promote', 'tab_')->where($map)->getField('id', true); @@ -1817,19 +1845,31 @@ class QueryController extends BaseController $field = $fieldUC . ',' . $fieldUI; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) - ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') ->where($map) ->group('uc.role_id,uc.server_id,uc.game_id') ->buildSql(); $query = M()->alias('record') ->table($subQuery) ->order($orderBy); + $total = M('user_play_data_count', 'tab_')->alias('uc') + ->field($fieldUC) + ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->where($map) + ->find(); list($records, $pagination, $count) = $this->paginate($query); foreach ($records as &$list) { - $list['user_account'] = encryption($list['user_account']); - $list['unlogin_day'] = intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $list['play_time']))) / (24 * 3600)); + $list['user_account'] = empty($list['user_account']) ? '--' : encryption($list['user_account']); + $list['game_name'] = empty($list['game_name']) ? '--' : $list['game_name']; + $list['sdk_version'] = empty($list['sdk_version']) ? '--' : getSDKTypeName($list['sdk_version']); + $list['server_name'] = empty($list['server_name']) ? '--' : $list['server_name']; + $list['role_name'] = empty($list['role_name']) ? '--' : $list['role_name']; + $list['role_level'] = empty($list['role_level']) ? '--' : $list['role_level']; + $list['unlogin_day'] = empty($list['play_time']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $list['play_time']))) / (24 * 3600)); + $list['play_time'] = empty($list['play_time']) ? '--' : date('Y-m-d H:i:s', $list['play_time']); + $list['promote_account'] = empty($list['promote_account']) ? '--' : $list['promote_account']; } } @@ -1839,6 +1879,7 @@ class QueryController extends BaseController $this->assign('records', $records); $this->assign('pagination', $pagination); $this->assign('count', $count); + $this->assign('total', $total); $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('sort', $sort); diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html index aefcaf46a..f8aecb696 100644 --- a/Application/Home/View/default/Finance/settlementDtl.html +++ b/Application/Home/View/default/Finance/settlementDtl.html @@ -164,11 +164,11 @@ {$vo.promote_account} {$vo.pay_amount} - 0 + 0.00 {$vo.pay_amount} {$vo.pay_amount} - 0 + 0.00 {$vo.selle_ratio}%|{$vo.selle_ratio}% {$vo.income} @@ -176,6 +176,19 @@ {$vo.selle_status} + + 合计 + -- + -- + -- + {$total.pay_amount} + {$total.direct_pay_amount} + {$total.inner_pay_amount} + -- + {$total.income} + -- + -- + diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html index e71bd2348..33b897948 100644 --- a/Application/Home/View/default/Home/landingPage.html +++ b/Application/Home/View/default/Home/landingPage.html @@ -17,7 +17,16 @@ {$game['relation_game_name']} - + + @@ -35,7 +44,9 @@
- +
+ +
{$game['relation_game_name']}
{$game['features']}
@@ -53,17 +64,18 @@
{$game['game_score']} -
- - - - - -
+ + +
+
+
+
+
+
14.48K个评分
-
+ @@ -83,7 +95,7 @@
简介
-
{$game['features']}
+
{$game['introduction']}
查看更多
@@ -106,7 +118,7 @@
-
+
@@ -160,7 +172,7 @@
信息
大小 -
{$game['game_size']}MB
+
{$game['game_size']}
类别 @@ -230,7 +242,7 @@
三、信任当前证书
- +
@@ -239,7 +251,7 @@
四、下载过程中若出现以下情况,请检查网络和内存再次尝试下载
- +
@@ -254,55 +266,141 @@
-
点我去信任
+
点我去信任
+ + + + + + {$game['relation_game_name']} + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Query/recharge.html b/Application/Home/View/default/Query/recharge.html index d7a658ae1..2fba74b25 100644 --- a/Application/Home/View/default/Query/recharge.html +++ b/Application/Home/View/default/Query/recharge.html @@ -127,8 +127,8 @@
- +
@@ -190,15 +190,15 @@ {$vo.user_account} - {$vo.order_number} + {$vo.pay_order_number} {:get_pay_way($vo['pay_way'])} {$vo.pay_amount} {$vo.game_name} {$vo.server_name} {$vo.game_player_name} - {$vo.p_p_pro_account}({$vo.p_p_pro_real_name}) - {$vo.p_pro_account}({$vo.p_pro_real_name}) - {$vo.pro_account}({$vo.pro_real_name}) + {$vo.p_p_pro_account}({$vo.p_p_pro_real_name}) + {$vo.p_pro_account}({$vo.p_pro_real_name}) + {$vo.pro_account}({$vo.pro_real_name}) {$vo.pay_time|date='Y-m-d H:i:s',###} @@ -206,6 +206,19 @@ + + 合计 + -- + -- + {$income} + -- + -- + -- + -- + -- + -- + -- +
diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index 98b80d789..fbc9d3f99 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -155,7 +155,7 @@ {$record.user_account} {$record.game_name} - {:getSDKTypeName($record['sdk_version'])} + {$record.sdk_version} {$record.server_name} {$record.role_name} {$record.role_level} @@ -163,10 +163,24 @@ {$record.recharge_count} {$record.recharge_cost_today} {$record.unlogin_day} - {$record.play_time|date='Y-m-d H:i:s',###} + {$record.play_time} {$record.promote_account} + + 合计 + -- + -- + -- + -- + -- + {$total.recharge_cost} + {$total.recharge_count} + {$total.recharge_cost_today} + -- + -- + -- + diff --git a/Application/Media/View/default/Article/article/detail1.html b/Application/Media/View/default/Article/article/detail1.html index 06fb0b828..b32639c92 100644 --- a/Application/Media/View/default/Article/article/detail1.html +++ b/Application/Media/View/default/Article/article/detail1.html @@ -70,7 +70,7 @@
  • 监护工程概述
  • 申请服务流程
  • -
  • 监护工程概述
  • +
  • 介绍详细说明
  • 健康提示
  • 纠纷处理
  • @@ -121,7 +121,7 @@
    -
    监护工程概述
    +
    介绍详细说明

    网络游戏未成年人家长监护工程”是一项由文化部指导,义乌市其豪网络科技有限公司旨在加强家长对未成年人参与网络游戏的监护,引导未成年人健康、绿色参与网络游戏,和谐家庭关系的行业自律行动。

    2010年2月5日,首批试点的六家企业共同启动“监护工程”,开始了游戏企业与未成年人家长联合共同预防未成年人沉迷网络游戏的有益尝试。实践中一些成功的案例让我们看到 “监护工程”提供了一种切实可行的方法,一种家长实施监控的管道,使家长纠正部分未成年子女沉迷网游成为可能。

    “监护工程”引导家长和未成年人正确面对网络游戏文化,加强相互沟通,在共同约定和认可的时间或规则下健康游戏,既保护了未成年人不受过度沉迷的伤害,也为家长指导未成年人健康游戏提供了有力的技术保障。

    @@ -239,7 +239,7 @@
    备案号:琼ICP备19000556号-1 diff --git a/Application/Media/View/default/Index/business.html b/Application/Media/View/default/Index/business.html index abf06a821..6366d4730 100644 --- a/Application/Media/View/default/Index/business.html +++ b/Application/Media/View/default/Index/business.html @@ -56,6 +56,7 @@
    备案号:琼ICP备19000556号-1 @@ -69,8 +70,8 @@
    - +
    - +
    \ No newline at end of file diff --git a/Application/Media/View/default/Index/hezuo.html b/Application/Media/View/default/Index/hezuo.html index c357556ae..57b45aa35 100644 --- a/Application/Media/View/default/Index/hezuo.html +++ b/Application/Media/View/default/Index/hezuo.html @@ -59,6 +59,7 @@
    备案号:琼ICP备19000556号-1 @@ -73,9 +74,9 @@
    - +
    - +
    diff --git a/Application/Media/View/default/Index/index.html b/Application/Media/View/default/Index/index.html index 69443cbc9..6fb32465c 100644 --- a/Application/Media/View/default/Index/index.html +++ b/Application/Media/View/default/Index/index.html @@ -31,6 +31,7 @@
    备案号:琼ICP备19000556号-1 @@ -44,7 +45,7 @@
    - +
    - +
    \ No newline at end of file diff --git a/Application/Media/View/default/Recharge/pay.html b/Application/Media/View/default/Recharge/pay.html index 06610c336..684f0617e 100644 --- a/Application/Media/View/default/Recharge/pay.html +++ b/Application/Media/View/default/Recharge/pay.html @@ -169,9 +169,9 @@
    您当前选择的是:支付宝
    - +
    -
    账户充值
    +
    账户充值
    @@ -187,7 +187,7 @@
    备案号:琼ICP备19000556号-1 diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index 86cec8911..0f974bb85 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -130,15 +130,15 @@ class SsgController extends BaseController { $_SESSION['user_id'] = $user_id; $user = M('user', 'tab_')->where(array( - 'id' => $user_id + 'id' => $user_id ))->find(); if (!$user['promote_id'] && $promote) { - M('user', 'tab_')->where(array( - 'id' => $user_id - ))->save(array( - 'promote_id' => $promoteId, - 'promote_account' => $promote['account'] - )); + M('user', 'tab_')->where(array( + 'id' => $user_id + ))->save(array( + 'promote_id' => $promoteId, + 'promote_account' => $promote['account'] + )); } } $this->ajaxReturn(array("ErrorCode"=>$res_code,"ResultMsg"=>$res_msg),'JSON'); @@ -182,15 +182,15 @@ class SsgController extends BaseController { #验证短信验证码 $this -> sms_verify($user['account'], $user['code']); - $res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id); - if(empty($res)){ + $res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id); + if(empty($res)){ $this -> set_message(1017, "fail", "添加失败"); - } - //添加自动登录 - $userApi = new MemberApi(); - $user_id = $userApi->login($user['account'], $user['password'],1); + } + //添加自动登录 + $userApi = new MemberApi(); + $user_id = $userApi->login($user['account'], $user['password'],1); - $this -> set_message(1, "success", "添加成功"); + $this -> set_message(1, "success", "添加成功"); } //忘记密码 @@ -229,18 +229,18 @@ class SsgController extends BaseController { $res = $this -> doRegister($account,$password,'',$promoteId,4,1); if(empty($res)){ $this -> set_message(1017, "fail", "添加失败"); - } + } - //添加自动登录 - $userApi = new MemberApi(); - $user_id = $userApi->login($account, $password,1); + //添加自动登录 + $userApi = new MemberApi(); + $user_id = $userApi->login($account, $password,1); - $this -> set_message(1, "success", "添加成功"); + $this -> set_message(1, "success", "添加成功"); # code... } //消息返回 - public function set_message($status=0,$return_code="fail",$return_msg="操作失败"){ + public function set_message($status=0,$return_code="fail",$return_msg="操作失败"){ $msg = array( "status" => $status, "return_code" => $return_code, @@ -249,6 +249,7 @@ class SsgController extends BaseController { $this->ajaxReturn($msg,'JSON'); exit(); } + //真正注册代码 public function doRegister($account,$password,$phone,$promote_id,$register_way,$register_type, $game_id = 0) { @@ -481,15 +482,14 @@ class SsgController extends BaseController { ))->find(); - $payLog = M('game_supersign', 'tab_')->where(array( + $isPay = M('game_supersign', 'tab_')->where(array( 'user_id' => $userId, - 'game_id' => $gameId + 'game_id' => $gameId, + 'pay_status' =>1 ))->find(); - if($payLog && $payLog['pay_status']==1){ - //$this->assign("error","亲~您已购买过了~
    请到【订单查询】查看订单信息哟~"); - //$this->display('blank'); - redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$payLog['order_id']); + if($isPay){ + redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$isPay['order_id']); }else{ if (!$gameInfo['supersign_token']) { //$this->error("超级签token未填写!"); @@ -526,27 +526,19 @@ class SsgController extends BaseController { exit(); } - $payLog = M('game_supersign', 'tab_')->where(array( + $isPay = M('game_supersign', 'tab_')->where(array( 'user_id' => $userId, - 'game_id' => $gameId - ))->find(); + 'game_id' => $gameId, + 'pay_status' => 1 + ))->find(); //是否有已支付订单 $gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array( 'id' => $gameId, ))->find(); - if ($payLog && $payLog['pay_status']==0) { - $orderId = $payLog['order_id']; - }elseif ($payLog && $payLog['pay_status']==1){ - /*$orderId = $payLog['order_id']; - if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){ - redirect("http://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId"); - }else{ - redirect("https://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId"); - }*/ + if ($isPay){ $this->assign("error","亲~您已购买过了~
    请到【订单查询】查看订单信息哟~"); $this->display('blank'); - //$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~"); exit(); } else { $orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签 diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index 48373ab45..dd57e2159 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -662,6 +662,8 @@ class UserController extends BaseController if (IS_POST) { $new_pwd = $_REQUEST['new_pwd']; $u_uid['phone'] = $_REQUEST['phone']; + //验证短信验证码 + $this->checksafecode($u_uid['phone'], $_REQUEST['code'], false); $result = M('user', 'tab_')->where($u_uid)->setField('password', think_ucenter_md5($new_pwd, UC_AUTH_KEY)); if ($result != false) { $this->success("修改成功", U('User/login')); @@ -893,8 +895,6 @@ class UserController extends BaseController } else { $model = M('User', 'tab_')->where($map)->save(array('phone' => '')); } - - $this->suser->set_login_info('phone', $_REQUEST['phone']); if ($model !== false) { @@ -1000,6 +1000,7 @@ class UserController extends BaseController } $logininfo = $this->suser->login_info(); + if (IS_POST) { $resdata['age_status'] = 0; @@ -1016,29 +1017,45 @@ class UserController extends BaseController // $this->ajaxReturn(array('status' => -1, 'info' => '身份证号码已被使用', 'url' => U('User/userauth'))); // } } - - if (C('tool_age.status') == 0) { + $status = M("Tool","tab_")->field("status")->where("name = 'tool_age'")->find()['status']; + if ($status == 0) { $this->ajaxReturn(array('status' => 0, 'info' => '实名认证暂未开启!', 'url' => U('User/userauth'))); } else { - $re = age_verify($_REQUEST['real_name'], $_REQUEST['idcard']); - if ($re == 0) { - $this->ajaxReturn(array('status' => 0, 'info' => '审核失败!', 'url' => U('User/userauth'))); - } - if ($re == -1) { - $this->ajaxReturn(array('status' => 0, 'info' => '短信数量已使用完!', 'url' => U('User/userauth'))); - } - if ($re == -2) { - $this->ajaxReturn(array('status' => 0, 'info' => '连接错误,请检查配置!', 'url' => U('User/userauth'))); - } - - if ($re == 1) { - $resdata['age_status'] = 2;//成年 - } - if ($re == 2) { - $resdata['age_status'] = 3;//未成年 + //PC_REAL_NAME_REGISTER + $ages = M("Config")->where("name = 'PC_REAL_NAME_REGISTER'")->field("value")->find()['value']; + + if($ages == "1"){ + $re =age_verify($_REQUEST['idcard'],$_REQUEST['real_name']); + if ($re == 0) { + $this->ajaxReturn(array('status' => 0, 'info' => '审核失败!', 'url' => U('User/userauth'))); + } + if ($re == -1) { + $this->ajaxReturn(array('status' => 0, 'info' => '短信数量已使用完!', 'url' => U('User/userauth'))); + } + if ($re == "202") { + $this->ajaxReturn(array('status' => 0, 'info' => '无法验证!【中心中无此身份证记录,军人转业,户口迁移等】', 'url' => U('User/userauth'))); + } + if ($re == "203") { + $this->ajaxReturn(array('status' => 0, 'info' => '异常情况!', 'url' => U('User/userauth'))); + } + if ($re == "204") { + $this->ajaxReturn(array('status' => 0, 'info' => '姓名格式不正确!', 'url' => U('User/userauth'))); + } + if ($re == "205") { + $this->ajaxReturn(array('status' => 0, 'info' => '身份证格式不正确!', 'url' => U('User/userauth'))); + } + if ($re == 1) { + $resdata = 2;//成年 + } + if ($re == 2) { + $resdata = 3;//未成年 + } + }else{ + $re = 2; + $resdata = 2; } + } - if ($re > 0) { $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); } @@ -1051,6 +1068,9 @@ class UserController extends BaseController } } else { $user = D('User')->where(array('id' => $logininfo['user_id']))->find(); + if($user["age_status"] > 0){ + $user["idcard"] = substr($user["idcard"],0,1)."***********".substr($user["idcard"],-1,1); + } $this->assign('user', $user); $this->display(); } @@ -1399,10 +1419,13 @@ class UserController extends BaseController $this->redirect('Mobile/User/login'); } $map['user_id'] = $this->suser->login_info('user_id'); - $data = D('DownRecord')->table('tab_down_record AS tdr') - ->field('tab_game.id,tab_game.dow_status,tab_game.game_name,tab_game.game_size,tab_game.dow_num,tab_game.icon,tab_game.features,tdr.user_id,tab_game.and_dow_address,tab_game.add_game_address,tab_game.ios_dow_address,tab_game.ios_game_address,tab_game.game_score,tab_game.sdk_version') + $data = D('DownRecord')->table('tab_user_game_login_record AS tdr') + ->field('tab_game.id,tab_game.dow_status,tab_game.game_name,tab_game.game_size,tab_game.dow_num, + tab_game.icon,tab_game.features,tdr.user_id,tab_game.and_dow_address,tab_game.add_game_address, + tab_game.ios_dow_address,tab_game.ios_game_address,tab_game.game_score,tab_game.sdk_version') ->join("tab_game ON tdr.game_id = tab_game.id") ->where($map) + ->group("tdr.user_id, tdr.game_id") ->select(); $this->assign("data", $data); diff --git a/Application/Mobile/View/Index/business.html b/Application/Mobile/View/Index/business.html index c11dbc52c..949beb895 100644 --- a/Application/Mobile/View/Index/business.html +++ b/Application/Mobile/View/Index/business.html @@ -5,45 +5,45 @@ background: #f5f5f5; } - - - - - - -
    -
    -
    -
    商务合作
    -
    COMPANY PROFILE
    -
    《海南万盟天下科技有限公司》,致力于引进和传播手机游戏,我们愿与广大开发者一同成长,将快乐分享给每一个玩家。欢迎广大开发者与工作人员联系,让您的游戏为我们平台锦上添花。
    -
    -
    市场合作
    -
    万盟天下一直坚持开放诚信高效的业务合作,欢迎各位业界同仁前来联系,互利共赢。
    -
    -
    -
    媒体合作
    -
    万盟天下一直希望通过广泛的市场及品牌合作,为用户提供更全面的产品与服务。
    -
    -
    -
    联系方式
    -
    公司地址:福建省福州市鼓楼区福大怡山文化创意园11号楼103号
    -
    联系人: 雷女士
    -
    联系电话: 13067391751
    -
    邮政编码:350004
    -
    -
    -
    -
    -
    + + + + + + +
    +
    +
    +
    商务合作
    +
    BUSINESS COOPERATION
    +
    《海南万盟天下科技有限公司》,致力于引进和传播手机游戏,我们愿与广大开发者一同成长,将快乐分享给每一个玩家。欢迎广大开发者与工作人员联系,让您的游戏为我们平台锦上添花。
    +
    +
    市场合作
    +
    万盟天下一直坚持开放诚信高效的业务合作,欢迎各位业界同仁前来联系,互利共赢。
    +
    +
    +
    商务合作
    +
    万盟天下一直希望通过广泛的市场及品牌合作,为用户提供更全面的产品与服务。
    +
    +
    +
    联系方式
    +
    公司地址:福建省福州市鼓楼区福大怡山文化创意园11号楼103号
    +
    联系人: 雷女士
    +
    联系电话: 13067391751
    +
    邮政编码:350004
    +
    +
    +
    +
    +
    - -
    -
    备案号:琼ICP备19000556号-1
    -
    网络文化经营许可证编号:琼网文(2019)2354-200号
    -
    海南万盟天下科技有限公司
    + +
    +
    备案号:琼ICP备19000556号-1
    +
    网络文化经营许可证编号:琼网文(2019)2354-200号
    +
    海南万盟天下科技有限公司
    +
    -
    @@ -61,7 +61,7 @@
    diff --git a/Application/Mobile/View/Index/index.html b/Application/Mobile/View/Index/index.html index 156399e17..919e99bee 100644 --- a/Application/Mobile/View/Index/index.html +++ b/Application/Mobile/View/Index/index.html @@ -19,8 +19,8 @@
    -
    - +
    +
    @@ -71,7 +71,7 @@
    diff --git a/Application/Mobile/View/Index/introduce.html b/Application/Mobile/View/Index/introduce.html index b30913d8a..dbe3a5b6a 100644 --- a/Application/Mobile/View/Index/introduce.html +++ b/Application/Mobile/View/Index/introduce.html @@ -46,7 +46,7 @@
    diff --git a/Application/Mobile/View/Ssg/login.html b/Application/Mobile/View/Ssg/login.html index 39187752f..7f396c1bb 100644 --- a/Application/Mobile/View/Ssg/login.html +++ b/Application/Mobile/View/Ssg/login.html @@ -325,6 +325,7 @@ var PhoneObj = { //登陆 $("#loginbtn").on("click",function(){ + var gameId = $("#game_id").val(); var loginName = $("#userAccount").val(); var loginPass = $("#password").val(); var userCode = $("#userCode").val(); @@ -365,7 +366,11 @@ var PhoneObj = { alert(result.ResultMsg); GetVerityCode(); } else { - window.location.href = "mobile.php?s=/Ssg/index.html" + if (gameId>0) { + window.location.href = "/mobile.php?s=/Ssg/pay/game_id/"+gameId+".html" + } else { + window.location.href = "/mobile.php?s=/Ssg/index.html" + } } } }); @@ -412,7 +417,12 @@ var PhoneObj = { //弹框确认 function hideAndLogin(){ $("#alert_box").hide(); - window.location.href = "mobile.php?s=/Ssg/index.html" + var gameId = $("#game_id").val(); + if (gameId) { + window.location.href = "/mobile.php?s=/Ssg/pay/game_id/"+gameId+".html" + } else { + window.location.href = "mobile.php?s=/Ssg/index.html" + } } //获取手机验证码 $("#getPhoneCode").on("click",function(){ diff --git a/Application/Mobile/View/User/forget.html b/Application/Mobile/View/User/forget.html index 1b1b536a5..96be5cbae 100644 --- a/Application/Mobile/View/User/forget.html +++ b/Application/Mobile/View/User/forget.html @@ -1,48 +1,47 @@ - - - + -
    +
    -
    找回密码 +
    忘记密码
    -
    - -
    -
    - -
    手机号
    +
    + - -
    -
    - -
    验证码
    - + + + + +
    +
    通过手机号找回密码只适用于手机号注册的账号
    +
    用户名注册的账号可联系客服
    -
    获取验证码
    -
    -
    下一步
    -
    -

    - 通过手机号找回密码只适用于手机号注册的账号
    用户名注册的账号可 - 联系客服 -

    -
    +
    @@ -90,27 +89,49 @@ $(".submit").click(function(){ var mobile = $.trim($("#mobile").val()); var code = $.trim($("#code").val()); + var new_pwd = $.trim($("#new_pwd").val()); + var new_pwd_confirm = $.trim($("#new_pwd_confirm").val()); if(mobile.length == 0){ pmsg.msg('请输入手机号码'); return false; } + if(new_pwd.length == 0){ + pmsg.msg('请输入密码'); + return false; + } + if(new_pwd_confirm.length == 0){ + pmsg.msg('请输入确认密码'); + return false; + } if(code.length == 0){ pmsg.msg('请输入验证码'); return false; } + if(new_pwd.length < 6 || new_pwd.length > 12){ + pmsg.msg('密码长度6-12个字符'); + return false; + } + if(new_pwd != new_pwd_confirm){ + pmsg.msg('两次密码输入不一致'); + return false; + } $.ajax({ - url:"{:U('forget')}", + url:"{:U('forget1')}", type:"POST", dataType:"json", - data:{phone:$.trim($('#mobile').val()),code:$("#code").val()}, + data:{ + phone:$.trim($('#mobile').val()), + code:$("#code").val(), + new_pwd:new_pwd + }, success:function(result){ if(result.status == 1){ - pmsg.msg("验证成功"); + pmsg.msg("修改成功"); setTimeout(function () { window.location.href = result.url; }, 2000); } else { - pmsg.msg(result.msg); + pmsg.msg(result.info ? result.info : result.msg); } }, error:function(){ diff --git a/Application/Mobile/View/User/index.html b/Application/Mobile/View/User/index.html index 846c51f04..7eb0bd4eb 100644 --- a/Application/Mobile/View/User/index.html +++ b/Application/Mobile/View/User/index.html @@ -76,7 +76,7 @@
    diff --git a/Application/Mobile/View/User/login.html b/Application/Mobile/View/User/login.html index a01e69225..52e38600a 100644 --- a/Application/Mobile/View/User/login.html +++ b/Application/Mobile/View/User/login.html @@ -13,7 +13,7 @@ -
    +
    diff --git a/Application/Mobile/View/User/usernick.html b/Application/Mobile/View/User/usernick.html index 5daa4d7ad..abe7f2e27 100644 --- a/Application/Mobile/View/User/usernick.html +++ b/Application/Mobile/View/User/usernick.html @@ -10,7 +10,7 @@
    -
    修改名字 +
    修改昵称
    diff --git a/Application/Mobile/View/User/userpassword.html b/Application/Mobile/View/User/userpassword.html index 9de7f1e4b..8837cc52c 100644 --- a/Application/Mobile/View/User/userpassword.html +++ b/Application/Mobile/View/User/userpassword.html @@ -4,47 +4,39 @@ - -
    -
    - -
    - -
    修改密码 - -
    -
    - -
    -
    - -
    原始密码
    -
    - -
    - -
    -
    - -
    新密码
    -
    - -
    - -
    -
    - -
    确认密码
    -
    - -
    - -
    保存修改
    -
    + + +
    + +
    修改密码 + +
    + +
    -
    + + + +
    + +
    +
    -
    绑定手机解除绑定
    -
    - -
    - - -
    -
    - -
    手机号
    + + - - -
    -
    - -
    手机号
    + + - -
    - - - - - -
    -
    - -
    验证码
    + + -
    获取验证码
    +
    -
    保存修改
    - - - -
    +
    diff --git a/Application/Mobile/View/User/userset.html b/Application/Mobile/View/User/userset.html index fb9891378..68b8ed751 100644 --- a/Application/Mobile/View/User/userset.html +++ b/Application/Mobile/View/User/userset.html @@ -84,7 +84,7 @@
    {$user['nickname']}
    -
    + -
    - 退出登录 +
    + 退出登录
    @@ -149,6 +149,7 @@ var pmsg = $('.popmsg').pop(); $('.portraitbtn').click(function () { + return false; //pmsg.msg('请到PC端网站或APP应用上更改'); var pop = $('.pop').addClass('pop-head').pop(); pop.open(800, '
    请到APP上更改头像
    '); diff --git a/Data/update.sql b/Data/update.sql index 1490c7dbf..c1c337020 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -613,3 +613,42 @@ order_time:切分时间' WHERE `id` = 29; --新增风控类型 ALTER TABLE `tab_device_bans` MODIFY COLUMN `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型 0未知 1设备号 2IP 3落地页链接 4下载链接' AFTER `tag`; + +-- user表注册类型添加7虚拟 +ALTER TABLE `tab_user` MODIFY COLUMN `register_type` tinyint(2) DEFAULT '1' COMMENT '注册方式 0游客1账号 2 手机 3微信 4QQ 5百度 6微博 7虚拟'; + +ALTER TABLE `tab_game_source` add COLUMN `is_new_sdk` tinyint(2) DEFAULT '0' COMMENT '是否新SDK(IOS)'; + + +--游戏评分字段改为保留小数1位 2019-12-03 郑昌隆--- +ALTER TABLE tab_game MODIFY COLUMN `game_score` double(3,1) DEFAULT '0' COMMENT '游戏评分'; + +--新增区服预告表 chenzhi 2019-12-04 +CREATE TABLE `tab_server_notice` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增', + `game_id` int(11) NOT NULL COMMENT '游戏id', + `game_name` varchar(30) NOT NULL COMMENT '游戏名称', + `server_name` varchar(30) NOT NULL COMMENT '区服名称', + `server_num` int(11) DEFAULT NULL COMMENT '对接区服id', + `recommend_status` tinyint(2) DEFAULT '1' COMMENT '推荐状态(0:否,1:是)', + `show_status` tinyint(2) DEFAULT '1' COMMENT '显示状态(0:否,1:是)', + `stop_status` tinyint(2) DEFAULT '0' COMMENT '是否停服(0:否,1:是)', + `server_status` tinyint(2) DEFAULT '0' COMMENT '区服状态(0:正常,1拥挤,2爆满)', + `icon` int(11) DEFAULT NULL COMMENT '区服图标', + `start_time` int(11) DEFAULT NULL COMMENT '开始时间', + `desride` varchar(300) DEFAULT NULL COMMENT '描述', + `prompt` varchar(300) DEFAULT NULL COMMENT '停服提示', + `parent_id` int(11) DEFAULT NULL COMMENT '父类id', + `create_time` int(11) DEFAULT NULL COMMENT '创建时间', + `server_version` tinyint(2) DEFAULT NULL COMMENT '运营平台 1and 2ios 0双平台', + `developers` int(11) DEFAULT '0' COMMENT '开发商', + `server_id` varchar(50) NOT NULL DEFAULT '' COMMENT '对接区服id', + PRIMARY KEY (`id`), + KEY `game_id` (`game_id`), + KEY `show_status` (`show_status`), + KEY `start_time` (`start_time`), + KEY `create_time` (`create_time`) +) ENGINE=InnoDB AUTO_INCREMENT=488 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='游戏区服预告表'; + +INSERT INTO `sys_model` ( `name`, `title`, `extend`, `relation`, `need_pk`, `field_sort`, `field_group`, `attribute_list`, `attribute_alias`, `template_list`, `template_add`, `template_edit`, `list_grid`, `list_row`, `search_key`, `search_list`, `create_time`, `update_time`, `status`, `engine_type`) +VALUES ('ServerNotice', '游戏区服预告', '0', '', '1', '{\"1\":[\"289\",\"288\",\"290\",\"291\",\"293\",\"292\",\"287\",\"286\",\"282\",\"281\",\"283\",\"284\",\"285\",\"280\"]}', '1:基础', '', '', '', '', '', 'id:编号\r\ngame_name:游戏名称\r\nserver_name:区服名称\r\nshow_status|get_info_status:区服状态\r\nstart_time|set_show_time:开服时间\r\nserver_version:运营平台\r\ndevelopers:开发商\r\nid:操作:[EDIT]&id=[id]|编辑,ServerNotice/del?ids=[id]|删除', '10', '', '', '1480318911', '1493879217', '1', 'MyISAM'); diff --git a/Public/Home/css/index2.css b/Public/Home/css/index2.css index 23c821134..9fefb9e17 100644 --- a/Public/Home/css/index2.css +++ b/Public/Home/css/index2.css @@ -11,9 +11,10 @@ align-items: center; justify-content: space-between; } -.heard>img{ +.heard>div>img{ width: 2.5rem; height: 2.5rem; + border-radius: 0.3rem; } .heard>.right{ margin-left: 0.3rem; @@ -70,11 +71,21 @@ .evaluate .start{ display: flex; align-items: center; - margin-left: 0.32rem; + margin-left: 0.22rem; } -.evaluate .start>img{ - width: 0.3rem; +.evaluate .start .iconImg{ + display: inline-block; + vertical-align: middle; + width: 1.84rem; height: 0.3rem; + background: url("../images/game_score1.png")no-repeat left center; + background-size: auto 100%; +} +.evaluate .start .iconImg>div{ + display: block; + height: 100%; + background: url("../images/game_score2.png")no-repeat left center; + background-size: auto 100%; } .evaluate-box{ display: flex; @@ -109,13 +120,14 @@ } .slide-item{ width: 4.4rem; - /* height: 6.22rem; */ + /*height: 6.22rem;*/ margin-right: 30px; list-style: none; } .slide-item >img{ width: 100%; - height: 100%; + height: 7.82rem; + pointer-events: none; } /*隐藏掉滚动条*/ .slide-box::-webkit-scrollbar { @@ -442,4 +454,60 @@ } .swiper-container-horizontal>.swiper-pagination-bullets{ bottom: -9px !important; -} \ No newline at end of file +} + +.safari{ + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.4); + display: flex; + flex-direction: column; + align-items: center; + font-family:PingFang SC; +} +.safari-heard{ + width: 6.3rem; + margin-top: 1.4rem; + font-size:0.36rem; + font-weight:500; + color:rgba(255,255,255,1); + display: flex; + justify-content: flex-end; +} +.safari-heard>div{ + margin-top: 0.65rem; +} +.safari-heard>img{ + width: 1rem; + height: 0.8rem; + margin-left: 0.25rem; +} +.safari-info{ + margin-top: 2.4rem; + background: url("../images/safari_bg.png") no-repeat; + width: 6.3rem; + height: 2.8rem; + background-size: 100% 100%; + display: flex; + align-items: center; + justify-content: center; +} +.safari-info>img{ + width: 1.5rem; + height: 1.5rem; + margin-right: 0.24rem; +} +.safari-info>div{ + color: #fff; + font-size: 0.32rem; + font-weight: 500; +} +.safari-info>div a{ + color: #FCE44B; + font-size: 0.32rem; + font-weight: 500; +} + diff --git a/Public/Home/images/2.png b/Public/Home/images/2.png index 146ce1e0a..465237466 100644 Binary files a/Public/Home/images/2.png and b/Public/Home/images/2.png differ diff --git a/Public/Home/images/3.png b/Public/Home/images/3.png index 22b6c05a5..c6f7b1b70 100644 Binary files a/Public/Home/images/3.png and b/Public/Home/images/3.png differ diff --git a/Public/Home/images/arror.png b/Public/Home/images/arror.png new file mode 100644 index 000000000..d6fe971b4 Binary files /dev/null and b/Public/Home/images/arror.png differ diff --git a/Public/Home/images/game_score1.png b/Public/Home/images/game_score1.png new file mode 100644 index 000000000..f7540a185 Binary files /dev/null and b/Public/Home/images/game_score1.png differ diff --git a/Public/Home/images/game_score2.png b/Public/Home/images/game_score2.png new file mode 100644 index 000000000..28b8b8026 Binary files /dev/null and b/Public/Home/images/game_score2.png differ diff --git a/Public/Home/images/safari.png b/Public/Home/images/safari.png new file mode 100644 index 000000000..b6e9cada8 Binary files /dev/null and b/Public/Home/images/safari.png differ diff --git a/Public/Home/images/safari_bg.png b/Public/Home/images/safari_bg.png new file mode 100644 index 000000000..be6e9c145 Binary files /dev/null and b/Public/Home/images/safari_bg.png differ diff --git a/Public/Media/css/supervise.css b/Public/Media/css/supervise.css index 0b5c91ade..b7973f266 100644 --- a/Public/Media/css/supervise.css +++ b/Public/Media/css/supervise.css @@ -54,6 +54,10 @@ background-color: #00A3E1; color: #fff; } + +.service_left .list li:hover{ + cursor:pointer; +} .service_left .content{ width: 100%; height: 400px; diff --git a/Public/Mobile/css/common.css b/Public/Mobile/css/common.css index 0af4f8f35..42343feb6 100644 --- a/Public/Mobile/css/common.css +++ b/Public/Mobile/css/common.css @@ -9,7 +9,7 @@ html { color:#333; overflow-x:hidden; margin: 0 auto; - max-width: 640px; + /*max-width: 640px;*/ } img { /*height: 100%;*/ @@ -39,7 +39,7 @@ body { -webkit-highlight: none; overflow:auto; -webkit-tap-highlight-color: rgba(0,0,0,0); - max-width:640px; + /*max-width:640px;*/ margin:0 auto; } .clearfix { diff --git a/Public/Mobile/css/forgetPass.css b/Public/Mobile/css/forgetPass.css new file mode 100644 index 000000000..a5d5c480e --- /dev/null +++ b/Public/Mobile/css/forgetPass.css @@ -0,0 +1,95 @@ +.loginPhTwo{ + width: 100%; + font-family:PingFang SC; +} +.login-box{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.login-input{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + display: flex; + align-items: center; + justify-content: center; + background:rgba(245,245,245,1); + border-radius:0.4rem; +} +.login-input>img{ + width: 0.42rem; + height: 0.42rem; +} +.login-input>input{ + font-size: 0.28rem; + border: 0; + outline: 0; + height: 0.6rem; + width: 4rem; + margin-left: 0.16rem; + background-color: rgba(245,245,245,1); +} +.login-input>input::placeholder{ + color: #A9A9A9; +} +.login-code{ + margin-top: 0.6rem; + display: flex; + align-items: center; + justify-content: center; +} +.login-code>input{ + width: 3rem; + height: 0.8rem; + background-color: #F5F5F5; + border-radius: 0.4rem; + font-size: 0.28rem; + text-align: center; + border: 0; + outline: 0; +} +.login-code>input::placeholder{ + text-align: center; + color: #A9A9A9; +} +.login-code>div{ + width: 2.3rem; + height: 0.8rem; + background-color: #389AED; + font-size: 0.28rem; + color: #FFFFFF; + border-radius: 0.4rem; + margin-left: 0.2rem; + text-align: center; + line-height: 0.8rem; +} +.login-btn{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + background-color: #389AED; + border-radius: 0.4rem; + font-size: 0.32rem; + color: #fff; + text-align: center; + line-height: 0.8rem; + outline: 0; + border: 0; + } + .forget-text{ + font-size: 0.24rem; + color: #292929; + margin-top: 0.3rem; + font-weight: 400; + text-align: center; + line-height: 0.4rem; + } + .forget-text a{ + color: #389AED; + font-size: 0.24rem; + font-weight: 400; + margin-left: 0.1rem; + cursor: pointer; + } \ No newline at end of file diff --git a/Public/Mobile/css/loginPhTwo.css b/Public/Mobile/css/loginPhTwo.css index aed18c2de..b70e5c175 100644 --- a/Public/Mobile/css/loginPhTwo.css +++ b/Public/Mobile/css/loginPhTwo.css @@ -77,4 +77,14 @@ line-height: 0.8rem; outline: 0; border: 0; - } \ No newline at end of file +} + +.login-agreement { + font-size: 0.24rem; + color: #292929; + margin-top: 0.32rem; +} +.login-agreement>a { + color: #389AED; + font-size: 0.24rem; +} \ No newline at end of file diff --git a/Public/Mobile/css/name.css b/Public/Mobile/css/name.css index 309d01557..434530438 100644 --- a/Public/Mobile/css/name.css +++ b/Public/Mobile/css/name.css @@ -45,4 +45,142 @@ line-height: 0.8rem; text-align: center; margin: 0.3rem auto 0 auto; -} \ No newline at end of file +} + +.remove-info{ + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + font-family:PingFang SC; +} +.remove-title{ + margin-top: 1.2rem; + font-size:0.4rem; + font-weight:500; + color:rgba(33,177,235,1); +} +.remove-input { + width: 3.6rem; + height: 0.78rem; + font-size: 0.28rem; + margin-top: 0.52rem; + color: #292929; + font-size: 0.24rem; + font-weight: 400; +} +.remove-input>div:last-child{ + margin-top: 0.28rem; +} + +.save{ + margin-top: 1.2rem; + width:5rem; + height:0.8rem; + background:rgba(33,177,235,1); + border-radius:0.4rem; + font-size:0.32rem; + font-family:PingFang SC; + font-weight:500; + color:rgba(255,255,255,1); + line-height: 0.8rem; + text-align: center; +} + +.loginPhTwo{ + width: 100%; + font-family:PingFang SC; +} +.login-box{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.login-input{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + display: flex; + align-items: center; + justify-content: center; + background:rgba(245,245,245,1); + border-radius:0.4rem; +} +.login-input>img{ + width: 0.42rem; + height: 0.42rem; +} +.login-input>input{ + font-size: 0.28rem; + border: 0; + outline: 0; + height: 0.6rem; + width: 4rem; + margin-left: 0.16rem; + background-color: rgba(245,245,245,1); +} +.login-input>input::placeholder{ + color: #A9A9A9; +} +.login-code{ + margin-top: 0.6rem; + display: flex; + align-items: center; + justify-content: center; +} +.login-code>input{ + width: 3rem; + height: 0.8rem; + background-color: #F5F5F5; + border-radius: 0.4rem; + font-size: 0.28rem; + text-align: center; + border: 0; + outline: 0; +} + +.login-code>input::placeholder{ + text-align: center; + color: #A9A9A9; +} +.login-code>div{ + width: 2.3rem; + height: 0.8rem; + background-color: #389AED; + font-size: 0.28rem; + color: #FFFFFF; + border-radius: 0.4rem; + margin-left: 0.2rem; + text-align: center; + line-height: 0.8rem; +} +.login-btn{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + background-color: #389AED; + border-radius: 0.4rem; + font-size: 0.32rem; + color: #fff; + text-align: center; + line-height: 0.8rem; + outline: 0; + border: 0; + } + .forget-text{ + font-size: 0.24rem; + color: #292929; + margin-top: 0.3rem; + font-weight: 400; + text-align: center; + line-height: 0.4rem; + } + .forget-text a{ + color: #389AED; + font-size: 0.24rem; + font-weight: 400; + margin-left: 0.1rem; + cursor: pointer; + } \ No newline at end of file diff --git a/Public/Mobile/css/password.css b/Public/Mobile/css/password.css new file mode 100644 index 000000000..a5d5c480e --- /dev/null +++ b/Public/Mobile/css/password.css @@ -0,0 +1,95 @@ +.loginPhTwo{ + width: 100%; + font-family:PingFang SC; +} +.login-box{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.login-input{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + display: flex; + align-items: center; + justify-content: center; + background:rgba(245,245,245,1); + border-radius:0.4rem; +} +.login-input>img{ + width: 0.42rem; + height: 0.42rem; +} +.login-input>input{ + font-size: 0.28rem; + border: 0; + outline: 0; + height: 0.6rem; + width: 4rem; + margin-left: 0.16rem; + background-color: rgba(245,245,245,1); +} +.login-input>input::placeholder{ + color: #A9A9A9; +} +.login-code{ + margin-top: 0.6rem; + display: flex; + align-items: center; + justify-content: center; +} +.login-code>input{ + width: 3rem; + height: 0.8rem; + background-color: #F5F5F5; + border-radius: 0.4rem; + font-size: 0.28rem; + text-align: center; + border: 0; + outline: 0; +} +.login-code>input::placeholder{ + text-align: center; + color: #A9A9A9; +} +.login-code>div{ + width: 2.3rem; + height: 0.8rem; + background-color: #389AED; + font-size: 0.28rem; + color: #FFFFFF; + border-radius: 0.4rem; + margin-left: 0.2rem; + text-align: center; + line-height: 0.8rem; +} +.login-btn{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + background-color: #389AED; + border-radius: 0.4rem; + font-size: 0.32rem; + color: #fff; + text-align: center; + line-height: 0.8rem; + outline: 0; + border: 0; + } + .forget-text{ + font-size: 0.24rem; + color: #292929; + margin-top: 0.3rem; + font-weight: 400; + text-align: center; + line-height: 0.4rem; + } + .forget-text a{ + color: #389AED; + font-size: 0.24rem; + font-weight: 400; + margin-left: 0.1rem; + cursor: pointer; + } \ No newline at end of file diff --git a/Public/Mobile/css/remove.css b/Public/Mobile/css/remove.css index 127d48c3d..15c1133b5 100644 --- a/Public/Mobile/css/remove.css +++ b/Public/Mobile/css/remove.css @@ -1,61 +1,95 @@ -.remove-info{ +.loginPhTwo{ width: 100%; + font-family:PingFang SC; } -.remove-input { - padding: 0.15rem 0.3rem; +.login-box{ display: flex; + flex-direction: column; align-items: center; - justify-content: space-between; - border-bottom: 1px solid #F5F5F5; - height: 0.78rem; - font-size: 0.28rem; + justify-content: center; } -.remove-inputBox { +.login-input{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; display: flex; align-items: center; - font-size:0.28rem; - font-family:PingFang SC; - font-weight:500; - color:rgba(41,41,41,1) + justify-content: center; + background:rgba(245,245,245,1); + border-radius:0.4rem; } -.remove-inputBox>img{ - width: 0.3rem; - height: 0.3rem; - margin-right: 0.23rem; +.login-input>img{ + width: 0.42rem; + height: 0.42rem; } -.remove-inputBox>input{ - width: 1.8rem; - height: 0.5rem; +.login-input>input{ + font-size: 0.28rem; border: 0; outline: 0; - padding: 0; + height: 0.6rem; + width: 4rem; + margin-left: 0.16rem; + background-color: rgba(245,245,245,1); +} +.login-input>input::placeholder{ + color: #A9A9A9; +} +.login-code{ + margin-top: 0.6rem; + display: flex; + align-items: center; + justify-content: center; +} +.login-code>input{ + width: 3rem; + height: 0.8rem; + background-color: #F5F5F5; + border-radius: 0.4rem; font-size: 0.28rem; - margin-left: 0.33rem; -} -.code{ - width:1.84rem; - height:0.6rem; - background:rgba(33,177,235,1); - border-radius:0.3rem; - font-size:0.28rem; - font-family:PingFang SC; - font-weight:400; - color:rgba(255,255,255,1); text-align: center; - line-height: 0.6rem; + border: 0; + outline: 0; +} +.login-code>input::placeholder{ + text-align: center; + color: #A9A9A9; } - -.save{ - width:5rem; - height:0.8rem; - background:rgba(33,177,235,1); - border-radius:0.4rem; - font-size:0.32rem; - font-family:PingFang SC; - font-weight:500; - color:rgba(255,255,255,1); +.login-code>div{ + width: 2.3rem; + height: 0.8rem; + background-color: #389AED; + font-size: 0.28rem; + color: #FFFFFF; + border-radius: 0.4rem; + margin-left: 0.2rem; + text-align: center; line-height: 0.8rem; +} +.login-btn{ + margin-top: 0.6rem; + width: 5.5rem; + height: 0.8rem; + background-color: #389AED; + border-radius: 0.4rem; + font-size: 0.32rem; + color: #fff; text-align: center; - margin: 0.3rem auto 0 auto; - margin-bottom: 10px; + line-height: 0.8rem; + outline: 0; + border: 0; +} +.forget-text{ + font-size: 0.24rem; + color: #292929; + margin-top: 0.3rem; + font-weight: 400; + text-align: center; + line-height: 0.4rem; +} +.forget-text a{ + color: #389AED; + font-size: 0.24rem; + font-weight: 400; + margin-left: 0.1rem; + cursor: pointer; } \ No newline at end of file diff --git a/Public/Mobile/images/suo.png b/Public/Mobile/images/suo.png new file mode 100644 index 000000000..ebb1ed28d Binary files /dev/null and b/Public/Mobile/images/suo.png differ diff --git a/Public/Mobile/images/user/mingzibianji2.png b/Public/Mobile/images/user/mingzibianji2.png new file mode 100644 index 000000000..f0ebdd268 Binary files /dev/null and b/Public/Mobile/images/user/mingzibianji2.png differ diff --git a/Public/Mobile/images/user/shimingrenzhengmoren2.png b/Public/Mobile/images/user/shimingrenzhengmoren2.png new file mode 100644 index 000000000..4a3fd1c6e Binary files /dev/null and b/Public/Mobile/images/user/shimingrenzhengmoren2.png differ diff --git a/Public/Mobile/js/home.js b/Public/Mobile/js/home.js index 9c8a6ef15..a131a6b20 100644 --- a/Public/Mobile/js/home.js +++ b/Public/Mobile/js/home.js @@ -1,17 +1,27 @@ $(function(){ var img = $(".swiper-container .swiper-slide").length; - var swiper = new Swiper('.swiper-container', { - loop: true, - pagination: { - el: '.swiper-pagination', - clickable: true, - }, - /*autoplay: { - delay: 3000, - stopOnLastSlide: false, - disableOnInteraction: false, - },*/ - autoplay: img > 1, - }); + + if(img<=1){ + var swiper = new Swiper('.swiper-container', { + loop: true, + autoplay: img > 1, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); + }else{ + var swiper = new Swiper('.swiper-container', { + loop: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + autoplay: { + stopOnLastSlide: false, + disableOnInteraction: false, + }, + }); + } }); \ No newline at end of file