优化代码

master
elf 2 years ago
parent 82a542786a
commit 7bfd05a179

@ -2997,21 +2997,22 @@ function getIsTask($user_id){
} }
} }
function encryption($string) { function encryption($string)
{
//订单隐藏算法 //订单隐藏算法
$orderLen = strlen($string); $orderLen = strlen($string);
$strLen = 3; $strLen = 3;
$hideChar = ''; $hideChar = '';
if($orderLen <=8) { if ($orderLen <= 8) {
$strLen = 2; $strLen = 2;
} }
for($i = 0;$i<$orderLen-$strLen*2;$i++) { for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .='*'; $hideChar .= '*';
} }
return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen-$strLen); return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen - $strLen);
} }
//导出csv //导出csv
function db2csv(&$data,$title,$header=false){ function db2csv(&$data,$title,$header=false){
@ -3071,3 +3072,32 @@ function getUserAccountOfPromote($account, $promote = null)
} }
return substr($account, 0, 2) . '******' . substr($account, 8); return substr($account, 0, 2) . '******' . substr($account, 8);
} }
function hideOrderNumber($orderNumber)
{
$orderLen = strlen($orderNumber);
$strLen = 4;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
return substr($orderNumber, 0, $strLen) . $hideChar . substr($orderNumber, $orderLen - $strLen);
}
function hidePromoteAccount($account) {
$orderLen = strlen($account);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
return substr($account, 0, $strLen) . $hideChar . substr($account, $orderLen - $strLen);
}

@ -2819,17 +2819,9 @@ public function iosDetailExcelInfo($id,$map) {
$data = M('promote_action_logs', 'tab_')->where($map)->order('create_time') $data = M('promote_action_logs', 'tab_')->where($map)->order('create_time')
->limit(($i-1)*$perSize ,$perSize)->select(); ->limit(($i-1)*$perSize ,$perSize)->select();
foreach($data as $dataKey => $dataValue) { foreach($data as $dataKey => $dataValue) {
$orderLen = strlen($dataValue['promote']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$csvData['module'] = $dataValue['module']; $csvData['module'] = $dataValue['module'];
$csvData['action_type'] = $dataValue['action_type']; $csvData['action_type'] = $dataValue['action_type'];
$csvData['user_account'] = substr($dataValue['promote'], 0, $strLen) . $hideChar . substr($dataValue['promote'], $orderLen - $strLen); $csvData['user_account'] = hidePromoteAccount($dataValue['promote']);
$csvData['create_time'] = date("Y-m-d H:i:s",$dataValue['create_time']); $csvData['create_time'] = date("Y-m-d H:i:s",$dataValue['create_time']);
$csvData['ip'] = $dataValue['ip']; $csvData['ip'] = $dataValue['ip'];
mb_convert_variables('GBK', 'UTF-8', $csvData); mb_convert_variables('GBK', 'UTF-8', $csvData);
@ -2873,19 +2865,12 @@ public function iosDetailExcelInfo($id,$map) {
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
$loginPromote = $this->getLoginPromote();
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$data = M('user_play_info','tab_')->where($map)->order('create_time desc') $data = M('user_play_info','tab_')->where($map)->order('create_time desc')
->limit(($i-1)*$perSize ,$perSize)->select(); ->limit(($i-1)*$perSize ,$perSize)->select();
foreach($data as $dataKey => $dataValue) { foreach($data as $dataKey => $dataValue) {
$orderLen = strlen($dataValue['user_account']); $csvData['user_account'] = getUserAccountOfPromote($dataValue['user_account'], $loginPromote);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$csvData['user_account'] = substr($dataValue['user_account'], 0, $strLen) . $hideChar . substr($dataValue['user_account'], $orderLen - $strLen);
$csvData['promote_account'] = $dataValue['promote_account']; $csvData['promote_account'] = $dataValue['promote_account'];
$csvData['game_name'] = $dataValue['game_name']; $csvData['game_name'] = $dataValue['game_name'];
if($dataValue['sdk_version'] == 1) { if($dataValue['sdk_version'] == 1) {
@ -2958,7 +2943,7 @@ public function iosDetailExcelInfo($id,$map) {
$record = [ $record = [
'id' => $parent['id'], 'id' => $parent['id'],
'account' => $parent['account'], 'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**', 'real_name' => hideRealName($parent['real_name']),
'level' => $parent['level'], 'level' => $parent['level'],
'game_name' => $game['game_name'], 'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'], 'sdk_version_text' => $game['sdk_version_text'],
@ -2972,7 +2957,7 @@ public function iosDetailExcelInfo($id,$map) {
$record = [ $record = [
'id' => $id, 'id' => $id,
'account' => $promote['account'], 'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**', 'real_name' => hideRealName($promote['real_name']),
'level' => $promote['level'], 'level' => $promote['level'],
'game_name' => $game['game_name'], 'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'], 'sdk_version_text' => $game['sdk_version_text'],
@ -2984,7 +2969,7 @@ public function iosDetailExcelInfo($id,$map) {
} }
$xlsData = []; $xlsData = [];
foreach ($records as $key1 => $value1) { foreach ($records as $key1 => $value1) {
$value1['account'] = $this->encryption($value1['account']); $value1['account'] = hidePromoteAccount($value1['account']);
$xlsData[] = $value1; $xlsData[] = $value1;
} }
$this->exportExcel($xlsName, $xlsCell, $xlsData,$tid); $this->exportExcel($xlsName, $xlsCell, $xlsData,$tid);
@ -3020,6 +3005,7 @@ public function iosDetailExcelInfo($id,$map) {
$accessNum = $count ?? 0; $accessNum = $count ?? 0;
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
$loginPromote = $this->getLoginPromote();
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$data = $model->where($map)->order('tab_pay_info.create_time desc') $data = $model->where($map)->order('tab_pay_info.create_time desc')
->limit(($i-1)*$perSize ,$perSize)->select(); ->limit(($i-1)*$perSize ,$perSize)->select();
@ -3030,12 +3016,8 @@ public function iosDetailExcelInfo($id,$map) {
$gameId = $v['game_id']; $gameId = $v['game_id'];
$serverInfo = M('server','tab_')->field('server_name')->where(['server_num'=>$serverId,'game_id'=>$gameId])->find(); $serverInfo = M('server','tab_')->field('server_name')->where(['server_num'=>$serverId,'game_id'=>$gameId])->find();
$v['promote_id']= $promoteInfo['account']; $v['promote_id']= $promoteInfo['account'];
/* if(empty($v['extend'])) {
$v['extend'] = $v['order_id'];
} */
// $csvData['extend'] = $this->encryption($v['extend']);
$csvData['create_time'] = $v['create_time']; $csvData['create_time'] = $v['create_time'];
$csvData['user_account'] = $this->encryption($v['user_account']); $csvData['user_account'] = getUserAccountOfPromote($v['user_account'], $loginPromote);
$csvData['game_name'] = $v['game_name']; $csvData['game_name'] = $v['game_name'];
$csvData['promote_id'] = $v['promote_id']; $csvData['promote_id'] = $v['promote_id'];
$csvData['server_name'] = $serverInfo['server_name']; $csvData['server_name'] = $serverInfo['server_name'];
@ -3086,6 +3068,7 @@ public function iosDetailExcelInfo($id,$map) {
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
$loginPromote = $this->getLoginPromote();
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$model = M('user','tab_'); $model = M('user','tab_');
@ -3096,9 +3079,9 @@ public function iosDetailExcelInfo($id,$map) {
->order('tab_user.id desc') ->order('tab_user.id desc')
->select(); ->select();
foreach($data as $value1) { foreach($data as $value1) {
$csvData['account'] = $this->encryption($value1['account']); $csvData['account'] = getUserAccountOfPromote($value1['account'], $loginPromote);
$csvData['promote_account'] = $value1['promote_account']; $csvData['promote_account'] = $value1['promote_account'];
$csvData['device_number'] = $this->encryption($value1['device_number']); $csvData['device_number'] = encryption($value1['device_number']);
$csvData['register_time'] = date("Y-m-d H:i:s",$value1['register_time']); $csvData['register_time'] = date("Y-m-d H:i:s",$value1['register_time']);
$csvData['register_ip'] = $value1['register_ip']; $csvData['register_ip'] = $value1['register_ip'];
$csvData['login_time'] = date("Y-m-d H:i:s",$value1['login_time']); $csvData['login_time'] = date("Y-m-d H:i:s",$value1['login_time']);
@ -3134,7 +3117,7 @@ public function iosDetailExcelInfo($id,$map) {
array('role_level','等级'), array('role_level','等级'),
array('create_time','创建时间'), array('create_time','创建时间'),
); );
$records = recordPromoteLogs('数据管理','角色查询导出'); recordPromoteLogs('数据管理','角色查询导出');
$map = json_decode(json_encode($map), true); $map = json_decode(json_encode($map), true);
@ -3166,8 +3149,9 @@ public function iosDetailExcelInfo($id,$map) {
->select(); ->select();
$xlsData = []; $xlsData = [];
$loginPromote = $this->getLoginPromote();
foreach ($data as $key1 => $value1) { foreach ($data as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']); $value1['user_account'] = getUserAccountOfPromote($value1['user_account'], $loginPromote);
if($value1['create_time'] == 0) { if($value1['create_time'] == 0) {
$value1['create_time'] = date('Y-m-d H:i:s', $value1['play_time']); $value1['create_time'] = date('Y-m-d H:i:s', $value1['play_time']);
} else { } else {
@ -3336,8 +3320,7 @@ public function iosDetailExcelInfo($id,$map) {
if($value1['status'] == 2) { if($value1['status'] == 2) {
$value1['promotestatus'] = "冻结中"; $value1['promotestatus'] = "冻结中";
} }
$realname = mb_strlen($value1['real_name'],'utf-8') == 2 ? mb_substr($value1['real_name'],0,1,'utf-8').'*':mb_substr($value1['real_name'],0,1,'utf-8').'**'; $value1['real_name'] = hideRealName($value1['real_name']);
$value1['real_name'] = $realname;
$value1['idcard'] = substr_replace($value1['idcard'],'************',3,12); $value1['idcard'] = substr_replace($value1['idcard'],'************',3,12);
$value1['create_time'] = date('Y-m-d H:i:s',$value1['create_time']); $value1['create_time'] = date('Y-m-d H:i:s',$value1['create_time']);
$xlsData[] = $value1; $xlsData[] = $value1;
@ -3354,7 +3337,7 @@ public function iosDetailExcelInfo($id,$map) {
array('status','资产状态'), array('status','资产状态'),
); );
$records = recordPromoteLogs('平台币管理','我的平台币导出'); recordPromoteLogs('平台币管理','我的平台币导出');
$data = M('PromoteBalanceCoin', 'tab_') $data = M('PromoteBalanceCoin', 'tab_')
->field('tab_promote_balance_coin.*,tab_game.game_name') ->field('tab_promote_balance_coin.*,tab_game.game_name')
->join('left join tab_game on tab_promote_balance_coin.game_id = tab_game.id') ->join('left join tab_game on tab_promote_balance_coin.game_id = tab_game.id')
@ -3399,7 +3382,7 @@ public function iosDetailExcelInfo($id,$map) {
foreach ($data as $item) { foreach ($data as $item) {
$records[] = [ $records[] = [
'id' => $item['id'], 'id' => $item['id'],
'sn' => $this->encryption($item['sn']), 'sn' => encryption($item['sn']),
'type_text' => $service->getTypeText($item['type']), 'type_text' => $service->getTypeText($item['type']),
'sub_type_text' => $service->getSubTypeText($item['sub_type']), 'sub_type_text' => $service->getSubTypeText($item['sub_type']),
'target_type_text' => $service->getTargetTypeText($item['target_type'], $item['target_level']), 'target_type_text' => $service->getTargetTypeText($item['target_type'], $item['target_level']),
@ -3471,8 +3454,8 @@ public function iosDetailExcelInfo($id,$map) {
} }
$records[] = [ $records[] = [
'id' => $log['id'], 'id' => $log['id'],
'sn' => $this->encryption($log['sn']), 'sn' => encryption($log['sn']),
'target_account' => $this->encryption($targetAccount), 'target_account' => encryption($targetAccount),
'game_name' => isset($games[$log['game_id']]) ? $games[$log['game_id']]['game_name'] : '所有游戏', 'game_name' => isset($games[$log['game_id']]) ? $games[$log['game_id']]['game_name'] : '所有游戏',
'target_type_text' => $service->getTargetTypeText($log['target_type'], $log['target_level']), 'target_type_text' => $service->getTargetTypeText($log['target_type'], $log['target_level']),
'num' => $log['num'], 'num' => $log['num'],
@ -3500,7 +3483,7 @@ public function iosDetailExcelInfo($id,$map) {
array('check_status',"状态"), array('check_status',"状态"),
array('create_time',"创建时间"), array('create_time',"创建时间"),
); );
$records = recordPromoteLogs('测试资源','测试资源导出'); recordPromoteLogs('测试资源','测试资源导出');
$data = M('test_resource','tab_') $data = M('test_resource','tab_')
->field("tab_test_resource.*,user.check_status") ->field("tab_test_resource.*,user.check_status")
->join('tab_user user on tab_test_resource.user_id=user.id','left') ->join('tab_user user on tab_test_resource.user_id=user.id','left')
@ -3508,9 +3491,10 @@ public function iosDetailExcelInfo($id,$map) {
->where($map) ->where($map)
->group("user_id,game_id,server_id") ->group("user_id,game_id,server_id")
->select(); ->select();
$loginPromote = $this->getLoginPromote();
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$value['create_time'] = date("Y-m-d H:i:s", $value['create_time']); $value['create_time'] = date("Y-m-d H:i:s", $value['create_time']);
$value['user_account'] = $this->encryption($value['user_account']); $value['user_account'] = getUserAccountOfPromote($value['user_account'], $loginPromote);
if($value['check_status'] == 1) { if($value['check_status'] == 1) {
$value['check_status'] = "正常"; $value['check_status'] = "正常";
}else { }else {
@ -3540,73 +3524,75 @@ public function iosDetailExcelInfo($id,$map) {
} }
public function testresourcelistExcelInfo($id,$map){ public function testresourcelistExcelInfo($id, $map)
{
$xlsName = "测试资源申请记录"; $xlsName = "测试资源申请记录";
$xlsCell = array( $xlsCell = array(
array('game_name',"游戏名称"), array('game_name', "游戏名称"),
array('server_name',"区服"), array('server_name', "区服"),
array('user_account',"测试账号"), array('user_account', "测试账号"),
array('phone',"手机号"), array('phone', "手机号"),
array('role_name',"角色名称"), array('role_name', "角色名称"),
array('apply_resource',"申请数量"), array('apply_resource', "申请数量"),
array('verify_resource',"实际发放"), array('verify_resource', "实际发放"),
array('apply_remark',"备注"), array('apply_remark', "备注"),
array('apply_status',"审核状态"), array('apply_status', "审核状态"),
array('verify_remark',"审核意见"), array('verify_remark', "审核意见"),
array('promote_account',"申请人"), array('promote_account', "申请人"),
array('create_time',"申请时间"), array('create_time', "申请时间"),
array('verify_time',"审核时间"), array('verify_time', "审核时间"),
); );
$records = recordPromoteLogs('测试资源','测试资源记录导出'); recordPromoteLogs('测试资源', '测试资源记录导出');
$data=M('test_resource','tab_')->where($map)->order('id desc')->select(); $data = M('test_resource', 'tab_')->where($map)->order('id desc')->select();
foreach($data as $key => $value) { $loginPromote = $this->getLoginPromote();
$data[$key]['user_account'] = $this->encryption($value['user_account']); foreach ($data as $key => $value) {
if($value['apply_status'] == 1) { $data[$key]['user_account'] = getUserAccountOfPromote($value['user_account'], $loginPromote);
if ($value['apply_status'] == 1) {
$data[$key]['apply_status'] = "审核未通过"; $data[$key]['apply_status'] = "审核未通过";
} } elseif ($value['apply_status'] == 2) {
elseif($value['apply_status'] == 2) {
$data[$key]['apply_status'] = "审核通过"; $data[$key]['apply_status'] = "审核通过";
} } else {
else {
$data[$key]['apply_status'] = "待审核"; $data[$key]['apply_status'] = "待审核";
} }
$data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); $data[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
$data[$key]['verify_time'] = date('Y-m-d H:i:s',$value['verify_time']); $data[$key]['verify_time'] = date('Y-m-d H:i:s', $value['verify_time']);
} }
$xlsData = $data; $xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id); $this->exportExcel($xlsName, $xlsCell, $xlsData, $id);
} }
public function supportNumberListExcelInfo($id,$map) { public function supportNumberListExcelInfo($id, $map)
{
$xlsName = "扶持号管理"; $xlsName = "扶持号管理";
$xlsCell = array( $xlsCell = array(
array('game_name',"产品名称"), array('game_name', "产品名称"),
array('server_name',"区服"), array('server_name', "区服"),
array('user_account',"测试账号"), array('user_account', "测试账号"),
array('promote_account',"所属推广员"), array('promote_account', "所属推广员"),
array('role_name',"角色名称"), array('role_name', "角色名称"),
array('device_number',"设备信息"), array('device_number', "设备信息"),
array('check_status',"状态"), array('check_status', "状态"),
array('create_time',"创建时间"), array('create_time', "创建时间"),
); );
$records = recordPromoteLogs('测试资源','扶持号管理导出'); recordPromoteLogs('测试资源', '扶持号管理导出');
$data = M('test_resource','tab_') $data = M('test_resource', 'tab_')
->field('tab_test_resource.id,tab_test_resource.user_id,tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,lock_status as check_status') ->field('tab_test_resource.id,tab_test_resource.user_id,tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,lock_status as check_status')
->join('left join tab_user as user on tab_test_resource.user_id = user.id') ->join('left join tab_user as user on tab_test_resource.user_id = user.id')
->where($map) ->where($map)
->order('tab_test_resource.create_time DESC') ->order('tab_test_resource.create_time DESC')
->select(); ->select();
$loginPromote = $this->getLoginPromote();
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$data[$key]['create_time'] = date('Y-m-d H:m:i',$value['create_time']); $data[$key]['create_time'] = date('Y-m-d H:m:i', $value['create_time']);
$data[$key]['user_account'] = $this->encryption($value['user_account']); $data[$key]['user_account'] = getUserAccountOfPromote($value['user_account'], $loginPromote);
if($value['check_status'] == 1) { if ($value['check_status'] == 1) {
$data[$key]['check_status'] = "启用"; $data[$key]['check_status'] = "启用";
}else { } else {
$data[$key]['check_status'] = "冻结"; $data[$key]['check_status'] = "冻结";
} }
} }
$xlsData = $data; $xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id); $this->exportExcel($xlsName, $xlsCell, $xlsData, $id);
} }
public function arpuExcelInfo($id,$params) { public function arpuExcelInfo($id,$params) {
@ -3748,11 +3734,12 @@ public function iosDetailExcelInfo($id,$map) {
->where($map) ->where($map)
->order('id desc') ->order('id desc')
->select(); ->select();
$loginPromote = $this->getLoginPromote();
if (!empty($data)) { if (!empty($data)) {
foreach ($data as $key => &$list) { foreach ($data as $key => &$list) {
$list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); $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']); $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
$list['user_account'] = $this->encryption($list['user_account']); $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote);
switch ($list['pay_way']) { switch ($list['pay_way']) {
case 2: case 2:
case 3: case 3:
@ -3894,6 +3881,7 @@ public function iosDetailExcelInfo($id,$map) {
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
$loginPromote = $this->getLoginPromote();
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$data = $model->field('pay_order_number,game_name,user_account,promote_id,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') $data = $model->field('pay_order_number,game_name,user_account,promote_id,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
@ -3924,8 +3912,8 @@ public function iosDetailExcelInfo($id,$map) {
foreach ($data as &$list) { foreach ($data as &$list) {
//提现状态 //提现状态
$list['pay_order_number'] = $this->encryption($list['pay_order_number']); $list['pay_order_number'] = encryption($list['pay_order_number']);
$list['user_account'] = $this->encryption($list['user_account']); $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote);
if ($list['pay_status'] == 1) { if ($list['pay_status'] == 1) {
switch ($list['selle_status']) { switch ($list['selle_status']) {
case 0: case 0:
@ -4352,7 +4340,7 @@ public function iosDetailExcelInfo($id,$map) {
} }
$xlsData = []; $xlsData = [];
foreach ($records as $key1 => $value1) { foreach ($records as $key1 => $value1) {
$value1['account'] = $this->encryption($value1['account']); $value1['account'] = encryption($value1['account']);
$xlsData[] = $value1; $xlsData[] = $value1;
} }
$this->exportExcel($xlsName, $xlsCell, $xlsData,$tid); $this->exportExcel($xlsName, $xlsCell, $xlsData,$tid);
@ -4493,6 +4481,7 @@ public function iosDetailExcelInfo($id,$map) {
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
$loginPromote = $this->getLoginPromote();
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$data = M()->alias('record') $data = M()->alias('record')
->table($subQuery) ->table($subQuery)
@ -4510,7 +4499,7 @@ public function iosDetailExcelInfo($id,$map) {
// if (empty($value['user_account']) ) { // if (empty($value['user_account']) ) {
// $value['user_account'] = $users[$value['user_id']] ?? ''; // $value['user_account'] = $users[$value['user_id']] ?? '';
// } // }
$csvData['user_account'] = empty($value['user_account']) ? '--' : encryption($value['user_account']); $csvData['user_account'] = empty($value['user_account']) ? '--' : getUserAccountOfPromote($value['user_account'], $loginPromote);
$csvData['game_name'] = empty($value['game_name']) ? '--' :$value['game_name']; $csvData['game_name'] = empty($value['game_name']) ? '--' :$value['game_name'];
$csvData['server_name'] = empty($value['server_name']) ? '--' :$value['server_name']; $csvData['server_name'] = empty($value['server_name']) ? '--' :$value['server_name'];
if($value['sdk_version'] == 1) { if($value['sdk_version'] == 1) {
@ -4610,6 +4599,7 @@ public function iosDetailExcelInfo($id,$map) {
$promoteIdData = []; $promoteIdData = [];
$promoteData = []; $promoteData = [];
$loginPromote = $this->getLoginPromote();
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$model = M('spend','tab_'); $model = M('spend','tab_');
$data = $model $data = $model
@ -4643,8 +4633,8 @@ public function iosDetailExcelInfo($id,$map) {
$value1['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['proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')';
// $value1['user_account'] = substr_replace($value1['user_account'],'************',3,12); // $value1['user_account'] = substr_replace($value1['user_account'],'************',3,12);
$value1['user_account'] = $this->encryption($value1['user_account']); $value1['user_account'] = getUserAccountOfPromote($value1['user_account'], $loginPromote);
$value1['pay_order_number'] = $this->encryption($value1['pay_order_number']); $value1['pay_order_number'] = encryption($value1['pay_order_number']);
$value1['payed_time'] = ($value1['pay_status'] == 1) ? date('Y-m-d H:i:s', $value1['payed_time']) : '--'; $value1['payed_time'] = ($value1['pay_status'] == 1) ? date('Y-m-d H:i:s', $value1['payed_time']) : '--';
$value1['pay_status'] = isset(self::$payStatus[$value1['pay_status']]) ? self::$payStatus[$value1['pay_status']] : "未知状态"; $value1['pay_status'] = isset(self::$payStatus[$value1['pay_status']]) ? self::$payStatus[$value1['pay_status']] : "未知状态";
$value1['sdk_version'] = getSDKTypeName($value1['sdk_version']); $value1['sdk_version'] = getSDKTypeName($value1['sdk_version']);

@ -218,21 +218,7 @@ class QueryController extends BaseController
$list['pay_time'] = ($list['pay_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--'; $list['pay_time'] = ($list['pay_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--';
$list['pay_status'] = isset(QueryController::$payStatus[$list['pay_status']]) ? QueryController::$payStatus[$list['pay_status']] : '未知状态'; $list['pay_status'] = isset(QueryController::$payStatus[$list['pay_status']]) ? QueryController::$payStatus[$list['pay_status']] : '未知状态';
$list['sdk_version'] = getSDKTypeName($list['sdk_version']); $list['sdk_version'] = getSDKTypeName($list['sdk_version']);
$list['pay_order_number'] = hideOrderNumber($list['pay_order_number']);
//订单隐藏算法
$orderLen = strlen($list['pay_order_number']);
$strLen = 4;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$list['pay_order_number'] = substr($list['pay_order_number'], 0, $strLen) . $hideChar . substr($list['pay_order_number'], $orderLen - $strLen);
} }
} }
@ -1847,18 +1833,6 @@ class QueryController extends BaseController
// var_dump($records);die(); // var_dump($records);die();
foreach ($records as $key => $value) { foreach ($records as $key => $value) {
//隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
if($records[$key]['create_time'] == 0) { if($records[$key]['create_time'] == 0) {
$records[$key]['create_time'] = date('Y-m-d', $value['play_time']) . '<br>' . date('H:i:s', $value['play_time']); $records[$key]['create_time'] = date('Y-m-d', $value['play_time']) . '<br>' . date('H:i:s', $value['play_time']);
} else { } else {
@ -2471,7 +2445,7 @@ class QueryController extends BaseController
$record = [ $record = [
'id' => $parent['id'], 'id' => $parent['id'],
'account' => $parent['account'], 'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**', 'real_name' => hideRealName($parent['real_name']),
'level' => $parent['level'], 'level' => $parent['level'],
'game_name' => $game['game_name'], 'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'], 'sdk_version_text' => $game['sdk_version_text'],
@ -2486,7 +2460,7 @@ class QueryController extends BaseController
$record = [ $record = [
'id' => $id, 'id' => $id,
'account' => $promote['account'], 'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**', 'real_name' => hideRealName($promote['real_name']),
'level' => $promote['level'], 'level' => $promote['level'],
'game_name' => $game['game_name'], 'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'], 'sdk_version_text' => $game['sdk_version_text'],
@ -2523,6 +2497,7 @@ class QueryController extends BaseController
$roleLevelEnd = intval(I('level_end', 0)); $roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0); $promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0); $isSelf = I('is_self', 0);
$loginPromote = $this->getLoginPromote();
if ($relationGameId != 0 || $sdkVersion != 0) { if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion); $gameIds = gameSearch($relationGameId, $sdkVersion);
@ -2557,20 +2532,7 @@ class QueryController extends BaseController
$query = M('user_play_info', 'tab_')->where($map)->order('create_time desc'); $query = M('user_play_info', 'tab_')->where($map)->order('create_time desc');
list($records, $pagination, $count) = $this->paginate($query); list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) { foreach ($records as $key => $value) {
//订单隐藏算法 $records[$key]['user_account'] = getUserAccountOfPromote($value['user_account'], $loginPromote);
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
} }
$this->assign('records', $records); $this->assign('records', $records);

Loading…
Cancel
Save