Merge branch 'feature/promote' of 47.111.118.107:/srv/git/platform into feature/promote

master
ELF 5 years ago
commit 2f4cd4c101

@ -5303,8 +5303,10 @@ if ($key == 'model'){
$xlsCell = array(
array('count_date','月份'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('balance_coin_deposit','平台币收入'),
array('inside_cash_count','内冲流水'),
array('bind_coin_count','内充支出'),
array('balance_coin_count','平台币支出'),
array('all_count','总流水'),
);
@ -5341,21 +5343,23 @@ if ($key == 'model'){
// $sumAll = D("spend_count")->sumSpendCountField($map,$allField);
$order = "id DESC";
$xlsData = M('spend_month_count','tab_')
->field("cash_count,balance_coin_count,inside_cash_count,all_count,count_date")
->field("cash_count,balance_coin_count,inside_cash_count,all_count,count_date,balance_coin_deposit,bind_coin_count")
->where($map)
->order($order)
->select();
$sumData = M('spend_month_count','tab_')
->field("sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count,sum(all_count) as all_count,count_date")
->field("sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count,sum(all_count) as all_count,count_date,sum(balance_coin_deposit) as balance_coin_deposit,sum(bind_coin_count) as bind_coin_count")
->where($map)
->order($order)
->find();
$sumData = [['count_date'=>'总计',
'cash_count'=>$sumData['cash_count'],
'balance_coin_count'=>$sumData['balance_coin_count'],
'balance_coin_deposit'=>$sumData['balance_coin_deposit'],
'inside_cash_count'=>$sumData['inside_cash_count'],
'bind_coin_count'=>$sumData['bind_coin_count'],
'balance_coin_count'=>$sumData['balance_coin_count'],
'all_count'=>$sumData['all_count']]];
$xlsData = array_merge($xlsData,$sumData);
@ -5373,8 +5377,8 @@ if ($key == 'model'){
array('game_name','游戏'),
array('partner_name','合作方'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('inside_cash_count','内冲流水'),
array('balance_coin_count','平台币支出'),
array('inside_cash_count','公会内充支出'),
array('all_cash_count','总流水'),
);
@ -5397,7 +5401,7 @@ if ($key == 'model'){
}
if (!empty(I('partner_id'))) {
$map['partner_id']=I('collaborate_id');
$map['partner_id']=I('partner_id');
}
if (I('sign') == 2&&empty(I('root_id'))) {
@ -5465,12 +5469,14 @@ if ($key == 'model'){
function gameFinanceDetail() {
set_time_limit(0);
ini_set('memory_limit', '512M');
$month = I("game_name");
$xlsName = $month.'充值流水';
$xlsCell = array(
array('pay_order_number','支付订单号'),
array('extend','游戏订单号'),
array('pay_time','充值时间'),
array('user_account','玩家账号'),
array('game_name','游戏名称'),
@ -5509,6 +5515,13 @@ if ($key == 'model'){
$map['promote_id'] = ['in',$promote_id];
}
if (!empty(I('partner_id'))&&empty(I("game_id"))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId];
}
if (!empty(I("count_date"))) {
$month = I("count_date");
$tarry = explode('-',$month);
@ -5527,22 +5540,102 @@ if ($key == 'model'){
$map['user_nickname'] = array('like',I("user_nickname").'%');
}
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,extend";
$group = "";
$order = "pay_time DESC";
$xlsData = D('spend')->getSpendData($map,$field,$group,$order);
for($start = $startTime;$start<$endTime;$start=$start+86400) {
$map['pay_time'] = array('between',array($start,$start+86400));
$xlsData1 = D('spend')->getSpendData($map,$field,$group,$order);
if ($xlsData1) {
$xlsData[date('m-d',$start)] = $xlsData1;
}
}
foreach($xlsData as $key => $value) {
$xlsData[$key]['pay_way'] = getPayType($value['pay_way']);
foreach ($value as $k => $v) {
$xlsData[$key][$k]['pay_way'] = getPayType($v['pay_way']);
$xlsData[$key][$k]['extend'] = "'".$v['extend'];
}
}
// dump($xlsData);die();
$map['pay_time'] = array('between',array($startTime,$endTime));
$sum = D('spend')->sumSpend($map,'pay_amount');
$sumData = [['pay_order_number'=>'总计',
$xlsData['10-'] = [['pay_order_number'=>'总计',
'pay_way'=>$sum]];
$xlsData = array_merge($xlsData,$sumData);
// $xlsData = array_merge($xlsData,$sumData);
// dump($xlsData);die();
$this->exportExcel($xlsName, $xlsCell, $xlsData);
$this->exportNewExcel($xlsName, $xlsCell, $xlsData);
}
public function exportNewExcel($expTitle, $expCellName, $expTableData)
{
$xlsTitle = iconv('utf-8', 'gb2312', $expTitle);//文件名称
// $fileName = session('user_auth.username').date('_YmdHis');//or $xlsTitle 文件名称可根据自己情况设定
$fileName = $expTitle;
$cellNum = count($expCellName);
$dataNum = count(current($expTableData));
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
$objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');//合并单元格
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', $expTitle);
$objPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->setActiveSheetIndex(0)->setTitle(key($expTableData));
for ($i = 0; $i < $cellNum; $i++) {
$objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][1]);
}
for ($i = 0; $i < $dataNum; $i++) {
for ($j = 0; $j < $cellNum; $j++) {
$objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), current($expTableData)[$i][$expCellName[$j][0]]);
}
}
// var_dump($expTableData);die();
unset($expTableData[key($expTableData)]);
$sheetNum = 1;
foreach($expTableData as $key => $value) {
$dataNum = count($value);
$objPHPExcel->createSheet();
if ($key==0) {
break;
}
if ($key == '10-') {
$objPHPExcel->setActiveSheetIndex($sheetNum)->setTitle('总计');
} else {
$objPHPExcel->setActiveSheetIndex($sheetNum)->setTitle($key);
}
$objPHPExcel->getActiveSheet($sheetNum)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');//合并单元格
$objPHPExcel->setActiveSheetIndex($sheetNum)->setCellValue('A1', $expTitle);
$objPHPExcel->setActiveSheetIndex($sheetNum)->getStyle('A1')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
for ($i = 0; $i < $cellNum; $i++) {
$objPHPExcel->setActiveSheetIndex($sheetNum)->setCellValue($cellName[$i] . '2', $expCellName[$i][1]);
}
for ($i = 0; $i < $dataNum; $i++) {
for ($j = 0; $j < $cellNum; $j++) {
$objPHPExcel->getActiveSheet($sheetNum)->setCellValue($cellName[$j] . ($i + 3), $value[$i][$expCellName[$j][0]]);
}
}
$sheetNum++;
}
//die();
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"');
header("Content-Disposition:attachment;filename=$fileName.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
function getPromoteList($root_id = 0) {
@ -5574,8 +5667,9 @@ if ($key == 'model'){
$xlsCell = array(
array('promote_account','会长渠道'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('inside_cash_count','内充流水'),
array('balance_coin_count','平台币支出'),
array('inside_cash_count','公会内充发放'),
array('bind_coin_count','公会内充支出'),
array('all_count','总流水'),
);
@ -5586,13 +5680,13 @@ if ($key == 'model'){
$map['parent_id'] = 0;
$map['root_id'] = 0;
$xlsData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)
->group('promote_id')
->select();
$sumData = M('spend_user_count','tab_')
->field('sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->field('sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)
->find();
@ -5601,6 +5695,7 @@ if ($key == 'model'){
'cash_count'=>$sumData['cash_count'],
'balance_coin_count'=>$sumData['balance_coin_count'],
'inside_cash_count'=>$sumData['inside_cash_count'],
'bind_coin_count'=>$sumData['bind_coin_count'],
'all_count'=>$sumData['all_count'],
]];
$xlsData = array_merge($xlsData,$sumData);
@ -5644,10 +5739,11 @@ if ($key == 'model'){
$xlsName = '组长月结统计';
$xlsCell = array(
array('promote_account','长渠道'),
array('promote_account','长渠道'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('inside_cash_count','内充流水'),
array('balance_coin_count','平台币支出'),
array('inside_cash_count','公会内充发放'),
array('bind_coin_count','公会内充支出'),
array('all_count','总流水'),
);
@ -5655,7 +5751,7 @@ if ($key == 'model'){
// $map['parent_id'] =$root_id;
$xlsData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)
->group('promote_id')
->select();
@ -5664,7 +5760,7 @@ if ($key == 'model'){
}
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)
->find();
if (empty(I("root_name"))) {
@ -5672,12 +5768,14 @@ if ($key == 'model'){
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count'] + $parentData[0]['balance_coin_count'], 2, '.', '');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count'] + $parentData[0]['inside_cash_count'], 2, '.', '');
$sumData['all_count'] = number_format($sumData['all_count'] + $parentData[0]['all_count'], 2, '.', '');
$sumData['bind_coin_count'] = number_format($sumData['bind_coin_count'] + $parentData[0]['bind_coin_count'], 2, '.', '');
}
$sumData = [['promote_account'=>'总计',
'cash_count'=>$sumData['cash_count'],
'balance_coin_count'=>$sumData['balance_coin_count'],
'inside_cash_count'=>$sumData['inside_cash_count'],
'bind_coin_count'=>$sumData['bind_coin_count'],
'all_count'=>$sumData['all_count'],
]];
$xlsData = array_merge($xlsData,$sumData);
@ -5715,16 +5813,17 @@ if ($key == 'model'){
$xlsName = '推广员月结统计';
$xlsCell = array(
array('promote_account','推广员渠道'),
array('promote_account','会长渠道'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('inside_cash_count','内充流水'),
array('balance_coin_count','平台币支出'),
array('inside_cash_count','公会内充发放'),
array('bind_coin_count','公会内充支出'),
array('all_count','总流水'),
);
//获取数据
$xlsData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)
->group('promote_id')
->select();
@ -5732,18 +5831,20 @@ if ($key == 'model'){
$xlsData = array_merge($parentData,$xlsData);
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
$sumData['bind_coin_count'] = number_format($sumData['bind_coin_count']+$parentData[0]['bind_coin_count'],2,'.','');
$sumData = [['promote_account'=>'总计',
'cash_count'=>$sumData['cash_count'],
'balance_coin_count'=>$sumData['balance_coin_count'],
'inside_cash_count'=>$sumData['inside_cash_count'],
'bind_coin_count'=>$sumData['bind_coin_count'],
'all_count'=>$sumData['all_count'],
]];
$xlsData = array_merge($xlsData,$sumData);
@ -5767,19 +5868,20 @@ if ($key == 'model'){
}
$data = M('spend_user_count','tab_')
->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(cash_count+balance_coin_count+inside_cash_count) as all_count')
->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map)->select();
$map1['parent_id'] = $data[0]['promote_id'];
$map1['count_date'] = $date;
$sunData = M('spend_user_count','tab_')
->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(cash_count+balance_coin_count+inside_cash_count) as all_count')
->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count')
->where($map1)->find();
$data[0]['cash_count'] = number_format($data[0]['cash_count']-$sunData['cash_count'],2,'.','');
$data[0]['balance_coin_count'] = number_format($data[0]['balance_coin_count']-$sunData['balance_coin_count'],2,'.','');
$data[0]['inside_cash_count'] = number_format($data[0]['inside_cash_count']-$sunData['inside_cash_count'],2,'.','');
$data[0]['all_count'] = number_format($data[0]['all_count']-$sunData['all_count'],2,'.','');
$data[0]['bind_coin_count'] = number_format($data[0]['bind_coin_count']-$sunData['bind_coin_count'],2,'.','');
// $map['inside_cash_count'] = ['neq',0];
// $insideData = D("spend_count")->getSpendCountData($map,"promote_id,inside_cash_count as count","promote_id,count_date");

@ -153,9 +153,9 @@ class FinanceController extends ThinkController
}
}
// if (!empty(I('partner_id'))) {
// $map['partner_id']=I('collaborate_id');
// }
if (!empty(I('partner_id'))) {
$map['partner_id']=I('partner_id');
}
@ -232,6 +232,7 @@ class FinanceController extends ThinkController
function gameFinanceDetail($p = 1) {
set_time_limit(0);
if (!empty(I("promote_id"))) {
$promote_id[] = I("promote_id");
}
@ -257,7 +258,13 @@ class FinanceController extends ThinkController
$map['promote_id'] = ['in',$promote_id];
}
if (!empty(I('partner_id'))&&empty(I("game_id"))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId];
}
// var_dump($map);die();
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$row=10;

@ -340,8 +340,8 @@ class PlatformController extends ThinkController
}
$user = M('User', 'tab_');
$map['promote_id'] = array('egt', 0);
$map['puid'] = 0;
// $map['promote_id'] = array('egt', 0);
// $map['puid'] = 0;
if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$map['register_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
unset($_REQUEST['timestart']);
@ -353,61 +353,42 @@ class PlatformController extends ThinkController
$map['register_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
unset($_REQUEST['timeend']);
}
$play_info_map = '';
if (isset($_REQUEST['game_name'])) {
$map['fgame_name'] = $_REQUEST['game_name'];
$play_info_map .= " and upi.game_name = '{$_REQUEST['game_name']}' ";
unset($_REQUEST['game_name']);
}
$today = total(1);
$week = total(2);
$mounth = total(3);
if (isset($_REQUEST['server_id'])) {
$map['server_name'] = $_REQUEST['server_id'];
$map['game_name'] = $map['fgame_name'];
$map['u.promote_id'] = $map['promote_id'];
unset($map['promote_id']);
unset($map['fgame_name']);
unset($_REQUEST['server_id']);
if (isset($_REQUEST['promote_id'])) {
$map['_string'] = "u.promote_id = {$_REQUEST['promote_id']} or tab_promote.parent_id = {$_REQUEST['promote_id']} or tab_promote.grand_id = {$_REQUEST['promote_id']} ";
unset($_REQUEST['promote_id']);
}
$data = M('user_play_info', 'tab_')->alias('u')
->field('u.promote_account,u.promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.user_id) as count,
IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,u.promote_id)) as promote_id1 ,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join('tab_user on tab_user.id = u.user_id')
->join('tab_promote on u.promote_id = tab_promote.id', 'left')
->where($map)
->group('promote_id1')
// ->having('u.promote_id != 0')
->order('count desc,register_time')
->select();
if (isset($_REQUEST['promote_id'])) {
$map['tp1.id'] = $_REQUEST['promote_id'];
} else {
if (isset($_REQUEST['promote_id'])) {
$map['_string'] = "promote_id = {$_REQUEST['promote_id']} or tab_promote.parent_id = {$_REQUEST['promote_id']} or tab_promote.grand_id = {$_REQUEST['promote_id']} ";
unset($_REQUEST['promote_id']);
}
$map['tp1.chain'] = '/';
}
$data = $user
->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count,
IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 ,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join('tab_promote on promote_id = tab_promote.id', 'left')
->where($map)
->group('promote_id1')
// ->having('promote_id != 0')
->order('count desc,register_time')
->select();
if (isset($_REQUEST['server_id'])) {
$play_info_map .= " and upi.server_name = '{$_REQUEST['server_id']}' ";
}
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%')", 'left')
->join("tab_user as u on tp2.id = u.promote_id", 'left')
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->where($map)
->group('tp1.id')
->order('count desc, register_time')
->select();
$count = count($data);
foreach ($data as $key => $value) {
static $i = 0;
@ -530,14 +511,14 @@ class PlatformController extends ThinkController
->group('promote_id')
->select(false);
}
$promote_map = "tp1.`chain` = '/'";
if (isset($_REQUEST['promote_id'])) {
$condition['_string'] = "promote_id = {$_REQUEST['promote_id']} or tab_promote.parent_id = {$_REQUEST['promote_id']} or tab_promote.grand_id = {$_REQUEST['promote_id']} ";
$promote_map = "tp1.`id` = {$_REQUEST['promote_id']}";
unset($_REQUEST['promote_id']);
}
$data = $spend->field('a.promote_account,a.promote_id,a.time,sum(a.scount) as count,sum(a.today) as today,sum(a.week) as week,sum(a.mounth) as mounth,IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1')
->join('tab_promote on promote_id = tab_promote.id', 'left')
->where($condition)
->table('(' . $data . ') as a')->group('promote_id1')->order('count desc,a.ordertime')->select();
$data = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') where $promote_map ) AS t ON promote_id = t.id")
->where($condition)->table('(' . $data . ') as a')->group('t.pid')->order('count desc,a.ordertime')->select();
$count = count($data);
// dump($condition);die;
foreach ($data as $key => $value) {

@ -10,6 +10,12 @@ class SdkMenuController extends ThinkController{
'2' => '外部链接',
];
public $menu_version = [
'0' => '双平台',
'1' => '安卓',
'2' => 'ios',
];
public function lists()
{
$menu_name = I('get.menu_name','sdk_menu');
@ -21,6 +27,7 @@ class SdkMenuController extends ThinkController{
{
$config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['HTTP_HOST'] . $v['icon'];
$config[$k]['type'] = $this->but_type[$v['type']];
$config[$k]['menu_version'] = $this->menu_version[$v['menu_version']];
}
}
$this->assign('list',$config);
@ -70,6 +77,7 @@ class SdkMenuController extends ThinkController{
$this->assign('data',$data);
$this->assign('menu_name',$menu_name);
$this->assign('but_type',$this->but_type);
$this->assign('menu_version',$this->menu_version);
$this->display('add');
}
@ -121,6 +129,7 @@ class SdkMenuController extends ThinkController{
$this->assign('data',$data);
$this->assign('menu_name',$menu_name);
$this->assign('but_type',$this->but_type);
$this->assign('menu_version',$this->menu_version);
$this->display('add');
}

@ -20,7 +20,7 @@ class SpendCountSetController extends \Think\Controller
$this->endThismonth = mktime(0,0,0,date('m'),1,date('Y'))-1;
$this->date = date('Y')."-".((date('m')-1) > 9 ? (date('m')-1) : "0".(date('m')-1));
$this->nowdata =time();
$this->model =M("spend_count",'tab_');
$this->model =M();
$this->usermodel =M("spend_user_count",'tab_');
$this->monthmodel =M("spend_month_count",'tab_');
$this->gamemodel =M("spend_count",'tab_');
@ -54,7 +54,7 @@ class SpendCountSetController extends \Think\Controller
"count_date"=>$this->date
);
$this->model->where($temp)->delete();
$this->gamemodel->where($temp)->delete();
$this->usermodel->where($temp)->delete();
$this->monthmodel->where($temp)->delete();
echo "重置成功执行重新生成:";
@ -75,18 +75,15 @@ class SpendCountSetController extends \Think\Controller
die("error:Repeated statistics,msg:{$this->date}已经聚合过");
}
$this->model->startTrans();
$this->usermodel->startTrans();
$this->continue =true;
//执行游戏表统计
$this->setGameCount();
// //执行用户表统计
// $this->setUserCount();
$this->setUserCount();
// //执行月份统计
// $this->setMonthCount();
$this->setMonthCount();
//执行
$this->model->commit();
$this->usermodel->commit();
$t2 = microtime(true);
die("success runtime:".round($t2-$t1,3).'s');
}
@ -136,7 +133,7 @@ class SpendCountSetController extends \Think\Controller
}
$field = "IFNULL(game.partner_id,0) partner_id,partner.partner partner_name,
spend.promote_id,spend.promote_account,spend.game_id,spend.game_name,sum(pay_amount) {$type},
IFNULL(promote.level,0) level,promote.chain,
IFNULL(promote.level,0) level,IFNULL(promote.chain,'/') chain,
'{$this->date}' as count_date,'{$this->nowdata}' as create_time";
$spendRes = M()
->table("tab_spend spend")
@ -167,7 +164,7 @@ class SpendCountSetController extends \Think\Controller
"count_date"=>$this->date
);
$dbres = $this->gamemodel->where($tempmap)->find();
if(!$dbres){
if(empty($dbres)){
//不存在
$tempdbres = $this->gamemodel->add($spendRes[$i]);
if(!$tempdbres){
@ -195,17 +192,17 @@ class SpendCountSetController extends \Think\Controller
public function setUserCount()
{
//获取会长信息
$this->getRootUser();
$this->getParentUser();
$this->getPromoteUser();
$this->getUserInsideData();
$adddata=array();
$userarr = array();
$this->getUserCountInit($adddata,$userarr);
$this->getUserInsideData($adddata,$userarr);
$this->addUserDb($adddata);
}
//用户聚合
public function getUserCountInit()
public function getUserCountInit(&$adddata,&$userarr)
{
$gameres = $this->gamemodel->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,chain,level,promote_id,promote_account")
$gameres = $this->gamemodel->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count,chain,level,promote_id,promote_account")
->where("count_date='{$this->date}'")->group("promote_id")->select();
if(empty($gameres)){
return;
@ -216,156 +213,42 @@ class SpendCountSetController extends \Think\Controller
//执行
for ($i=0; $i < $count; $i++) {
$d = $gameres[$i];
if($d['level'] == 0){
if($d['level'] < 2){
$adddata[$d['promote_id']] = $d;
$userarr[] =$d['promote_id'];
// $tempdbres = $this->usermodel->add($d);
}else{
//获取所有链路
$chain = trim($d['chain'],"/");
$pid = explode("/", $chain);
$pid[] = $d['promote_id'];//添加自己
for ($k=0; $k <count($pid); $k++) {
if(in_array($pid[$k], $userarr)){
//存在
// $adddata[$pid[$k]]["cash_count"] += $d;
$adddata[$pid[$k]]["cash_count"] += $d['cash_count'];
$adddata[$pid[$k]]["balance_coin_count"] += $d['balance_coin_count'];
$adddata[$pid[$k]]["bind_coin_count"] += $d['bind_coin_count'];
}else{
//不存在
//获取链路
$temp = $this->getChain($pid[$k]);
$temp['cash_count'] = $d['cash_count'];
$temp['balance_coin_count'] = $d['balance_coin_count'];
$temp['bind_coin_count'] = $d['bind_coin_count'];
$adddata[$pid[$k]] = $temp;
$userarr[] =$pid[$k];
}
# code...
}
// dump($pid);
}
# code...
}
dump($adddata);
dump($userarr);
}
protected function createUser(){
}
//获取会长信息
protected function getRootUser()
{
if(!$this->continue) die("api error");
//获取所有数据
$month = $this->date;
$from = "
(
SELECT root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE root_id > 0 and count_date='{$month}' group by root_id
UNION ALL
SELECT promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id = 0 and count_date='{$month}' group by promote_id
UNION ALL
SELECT parent_id,parent_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id > 0 and root_id = 0 and count_date='{$month}' group by parent_id
)
";
$subQueryAll = M()->table($from." a")
->field('root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count')
->group("a.root_id")
// ->having("cash_count > 0 OR balance_coin_count > 0")
->select();
for ($i=0; $i<count($subQueryAll); $i++) {
$adddata = array(
"promote_id"=>$subQueryAll[$i]['root_id'],
"promote_account"=>$subQueryAll[$i]['root_name'],
"parent_id"=>0,
"parent_name"=>'官方渠道',
"root_id"=>0,
"root_name"=>'官方渠道',
"cash_count"=>$subQueryAll[$i]['cash_count'],
"balance_coin_count"=>$subQueryAll[$i]['balance_coin_count'],
"all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count'],
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
$tempdbres = $this->usermodel->add($adddata);
if(!$tempdbres){
$this->usermodel->rollback();
die("getRootUser error");
}
}
}
//获取组长信息
protected function getParentUser()
{
if(!$this->continue) die("api error");
$month =$this->date;
//获取数据
$from = "
(
SELECT parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE root_id > 0 and count_date='{$month}' group by parent_id
UNION
SELECT promote_id,promote_account,parent_id,parent_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id >0 and root_id = 0 and count_date='{$month}' group by promote_id
)
";
$subQueryAll = M()->table($from." a")
->field('parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count')
->group("a.parent_id")
// ->having("cash_count > 0 or balance_coin_count > 0 ")
->select();
for ($i=0; $i<count($subQueryAll); $i++) {
$adddata = array(
"promote_id"=>$subQueryAll[$i]['parent_id'],
"promote_account"=>$subQueryAll[$i]['parent_name'],
"parent_id"=>$subQueryAll[$i]['root_id'],
"parent_name"=>$subQueryAll[$i]['root_name'],
"root_id"=>0,
"root_name"=>'官方渠道',
"cash_count"=>$subQueryAll[$i]['cash_count'],
"balance_coin_count"=>$subQueryAll[$i]['balance_coin_count'],
"all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count'],
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
$tempdbres = $this->usermodel->add($adddata);
if(!$tempdbres){
$this->usermodel->rollback();
die("getParentUser error");
}
}
}
//获取组员
protected function getPromoteUser()
{
if(!$this->continue) die("api error");
$month = $this->date;;
//获取数据
$from = "
(
SELECT promote_id,promote_account,parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id > 0 and root_id > 0 and count_date='{$month}' group by promote_id
)
";
$subQueryAll = M()->table($from." a")
->field('*')
->group("a.promote_id")
// ->having("cash_count > 0 or balance_coin_count > 0")
->select();
for ($i=0; $i<count($subQueryAll); $i++) {
$adddata = array(
"promote_id"=>$subQueryAll[$i]['promote_id'],
"promote_account"=>$subQueryAll[$i]['promote_account'],
"parent_id"=>$subQueryAll[$i]['parent_id'],
"parent_name"=>$subQueryAll[$i]['parent_name'],
"root_id"=>$subQueryAll[$i]['root_id'],
"root_name"=>$subQueryAll[$i]['root_name'],
"cash_count"=>$subQueryAll[$i]['cash_count'],
"balance_coin_count"=>$subQueryAll[$i]['balance_coin_count'],
"all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count'],
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
$tempdbres = $this->usermodel->add($adddata);
if(!$tempdbres){
$this->usermodel->rollback();
die("getPromoteUser error");
}
}
# code...
//获取chain
protected function getChain($id){
return M("Promote","tab_")->field("id promote_id,account promote_account,chain,level")->where("id='".$id."'")->find();
}
//渠道角色统计仅计算推广员的平台币发放与收回
protected function getUserInsideData()
protected function getUserInsideData(&$adddata,&$userarr)
{
// if(!$this->continue) die("api error");
//获取发送给推广员的数据
$insideRes = M()
->table("tab_promote_coin")
->field("*")
@ -381,161 +264,72 @@ class SpendCountSetController extends \Think\Controller
if($insideRes[$i]['type'] > 1){
$insideRes[$i]['num'] = ( 0- $insideRes[$i]['num']);
}
$this->createUserCount($insideRes[$i]['promote_id'],$insideRes[$i]['num']);
}
}
}
//建立user表空数据
protected function createUserCount($promote_id,$inside_cash_count)
{
$promote = M("Promote","tab_")->field("id,account,parent_id,parent_name,grand_id,grand_account")->where("id='".$promote_id."'")->find();
if(empty($promote)){
return false;
}
$temprootarr=array(
"parent_id"=>0,
"root_id"=>0,
"inside_cash_count"=>$inside_cash_count,
"all_count"=>$inside_cash_count,
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
$tempparentarr=array(
"root_id"=>0,
"inside_cash_count"=>$inside_cash_count,
"all_count"=>$inside_cash_count,
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
$temppromotearr=array(
"inside_cash_count"=>$inside_cash_count,
"all_count"=>$inside_cash_count,
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
if($promote["parent_id"] == 0){
//会长
$dbres = M("spend_user_count","tab_")->where(array(
"promote_id"=>$promote["id"],
"count_date"=>$this->date
))->find();
if(empty($dbres)){
$temprootarr["promote_id"]= $promote['id'];
$temprootarr["promote_account"]= $promote['account'];
$this->usermodel->add($temprootarr);
}else{
//叠加
$this->setInsideCount($promote['id'],$inside_cash_count);
}
}elseif($promote["parent_id"] > 0 && $promote["grand_id"] == 0){
//是组长
//添加会长
$dbres = M("spend_user_count","tab_")->where(array(
"promote_id"=>$promote["parent_id"],
"count_date"=>$this->date
))->find();
if(empty($dbres)){
//获取链路
$d = $this->getChain($insideRes[$i]['promote_id']);
$temprootarr["promote_id"]= $promote['parent_id'];
$temprootarr["promote_account"]= $promote['parent_name'];
$this->usermodel->add($temprootarr);
}else{
//叠加
$this->setInsideCount($promote['parent_id'],$inside_cash_count);
}
//添加自己
$dbres = M("spend_user_count","tab_")->where(array(
"promote_id"=>$promote["id"],
"count_date"=>$this->date
))->find();
if(empty($dbres)){
$tempparentarr['promote_id']=$promote['id'];
$tempparentarr['promote_account']=$promote['account'];
$tempparentarr['parent_id']=$promote["parent_id"];
$tempparentarr['parent_name']=$promote["parent_name"];
$this->usermodel->add($tempparentarr);
}else{
//叠加
$this->setInsideCount($promote['id'],$inside_cash_count);
}
}else{
//推广员
//添加会长
$dbres = M("spend_user_count","tab_")->where(array(
"promote_id"=>$promote["grand_id"],
"count_date"=>$this->date
))->find();
if(empty($dbres)){
$temprootarr["promote_id"]= $promote['grand_id'];
$temprootarr["promote_account"]= $promote['grand_account'];
$this->usermodel->add($temprootarr);
}else{
//叠加
$this->setInsideCount($promote['grand_id'],$inside_cash_count);
}
//添加组长
$dbres = M("spend_user_count","tab_")->where(array(
"promote_id"=>$promote["parent_id"],
"count_date"=>$this->date
))->find();
if(empty($dbres)){
$tempparentarr["promote_id"]= $promote['parent_id'];
$tempparentarr["promote_account"]= $promote['parent_name'];
$tempparentarr['parent_id']=$promote["grand_id"];
$tempparentarr['parent_name']=$promote["grand_account"];
$this->usermodel->add($tempparentarr);
}else{
//叠加
$this->setInsideCount($promote['parent_id'],$inside_cash_count);
}
$dbres = M("spend_user_count","tab_")->where(array(
"promote_id"=>$promote["id"],
"count_date"=>$this->date
))->find();
if(empty($dbres)){
$temppromotearr['promote_id']=$promote['id'];
$temppromotearr['promote_account']=$promote['account'];
$temppromotearr['parent_id']=$promote["parent_id"];
$temppromotearr['parent_name']=$promote["parent_name"];
$temppromotearr['root_id']=$promote['grand_id'];
$temppromotearr['root_name']=$promote['grand_account'];
$this->usermodel->add($temppromotearr);
}else{
//叠加
$this->setInsideCount($promote['id'],$inside_cash_count);
$chain = trim($d['chain'],"/");
$pid = explode("/", $chain);
$pid[] = $d['promote_id'];//添加自己
if($d['level'] < 2){
if(in_array($d["promote_id"], $userarr)){
//存在
$adddata[$pid[$k]]["inside_cash_count"] += $insideRes[$i]['num'];
}else{
$d['inside_cash_count'] = $insideRes[$i]['num'];
$adddata[$d['promote_id']] = $d;
$userarr[] =$d['promote_id'];
}
}else{
for ($k=0; $k <count($pid); $k++) {
if(in_array($pid[$k], $userarr)){
//存在
$adddata[$pid[$k]]["inside_cash_count"] += $insideRes[$i]['num'];
}else{
//不存在
//获取链路
$temp = $this->getChain($pid[$k]);
$temp['inside_cash_count'] = $insideRes[$i]['num'];
$adddata[$pid[$k]] = $temp;
$userarr[] =$pid[$k];
}
}
}
}
//添加自己
}
# code...
}
//按角色修正inside_cash_count数据
protected function setInsideCount($promote_id,$inside_cash_count)
{
$tempmap = array(
"promote_id"=>$promote_id,
"count_date"=>$this->date
);
$dbres = M("spend_user_count","tab_")->where($tempmap)->find();
$savedata = array("inside_cash_count"=>$inside_cash_count-0+$dbres['inside_cash_count'],"all_count"=>$inside_cash_count-0+$dbres['all_count']);
$tempdbres = $this->usermodel->where($tempmap)->save($savedata);
if($tempdbres === false){
$this->usermodel->rollback();
die("setInsideCount error");
//添加用户统计表
protected function addUserDb(&$adddata){
$count = count($adddata);
if($count < 1){return;}
foreach ($adddata as $k => $v) {
isset($v["cash_count"]) || $v["cash_count"]=0;
isset($v["balance_coin_count"]) || $v["balance_coin_count"]=0;
isset($v["bind_coin_count"]) || $v["bind_coin_count"]=0;
isset($v["inside_cash_count"]) || $v["inside_cash_count"]=0;
//设定时间
$v["count_date"] = $this->date;
$v["create_time"] = $this->nowdata;
//聚合不含内充流水
$v['all_count'] = $v["cash_count"]-0+$v["balance_coin_count"]-0+$v["bind_coin_count"];
$tempdbres = $this->usermodel->add($v);
if($tempdbres === false){
$this->model->rollback();
die("addUserDb error");
}
}
# code...
}
/** --------以下为设定月份聚合---------- **/
/**
* @param 现金流水 cash_count 游戏中充值的现金
* @param 平台币流水 balance_coin_count 游戏中消耗的平台币
* @param 绑定币流水 bind_coin_count 游戏中绑定币的消耗
* @param 内充流水 inside_cash_count:(推广员的平台币发放-收回)+(后台发放给玩家平台币-回收平台币 + (后台发放绑币给玩家 -回收的绑币)
* @param 平台币充值 balance_coin_deposit
* @return void
*/
public function setMonthCount()
{
$initdata = $this->getMonthInit();
@ -547,7 +341,11 @@ class SpendCountSetController extends \Think\Controller
$initdata["all_count"] = $initdata["inside_cash_count"]-0+$initdata["cash_count"]-0+$deposit;
$initdata["count_date"] = $this->date;
$initdata["create_time"] = $this->nowdata;
M("spend_month_count","tab_")->add($initdata);
$tempdbres = $this->monthmodel->add($initdata);
if($tempdbres === false){
$this->model->rollback();
die("setMonthCount error");
}
# code...
}
//获取除了内充的
@ -555,9 +353,9 @@ class SpendCountSetController extends \Think\Controller
{
$tempmap = array(
"count_date"=>$this->date,
"parent_id"=>0
"level"=>array("LT",2)
);
return M("spend_user_count","tab_")->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count")->where($tempmap)->find();
return $this->usermodel->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(bind_coin_count) bind_coin_count,sum(inside_cash_count) inside_cash_count")->where($tempmap)->find();
}
//获取平台币充值流水
protected function getBalanceDeposit()

@ -1 +1 @@
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":21},{"time":"17:00","count":10},{"time":"18:00","count":7},{"time":"19:00","count":11},{"time":"20:00","count":11},{"time":"21:00","count":8},{"time":"22:00","count":11},{"time":"23:00","count":10}],"sum":{"news":89,"active":2506,"player":378,"money":33093},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":851},{"time":"17:00","count":280},{"time":"18:00","count":142},{"time":"19:00","count":105},{"time":"20:00","count":81},{"time":"21:00","count":143},{"time":"22:00","count":420},{"time":"23:00","count":484}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":179},{"time":"17:00","count":54},{"time":"18:00","count":28},{"time":"19:00","count":24},{"time":"20:00","count":14},{"time":"21:00","count":12},{"time":"22:00","count":27},{"time":"23:00","count":40}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":"15639.00"},{"time":"17:00","count":"5328.00"},{"time":"18:00","count":"5490.00"},{"time":"19:00","count":"1178.00"},{"time":"20:00","count":"1274.00"},{"time":"21:00","count":"484.00"},{"time":"22:00","count":"2327.00"},{"time":"23:00","count":"1373.00"}]}
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":0,"player":0,"money":0},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}

@ -177,7 +177,7 @@
<a href="{:U('Finance/gameFinanceDetail',
array('count_date'=>$_REQUEST['count_date'],'root_id'=>$_GET['root_id'],'partner_id'=>$_REQUEST['partner_id'],
'parent_id'=>$_REQUEST['parent_id'],'promote_id'=>$_REQUEST['promote_id'],'game_id'=>$_REQUEST['game_id'],'game_name'=>'全部游戏',
'sign'=>$_REQUEST['sign'],'from'=>$_REQUEST['from']))}" >查看</a>
'sign'=>$_REQUEST['sign'],'from'=>$_REQUEST['from'],'all'=>1))}" >查看</a>
</td>
</tr>
</notemtpy>

@ -42,8 +42,10 @@
<div class="input-list">
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/gameFinanceDetail',
array('count_date'=>$_GET['count_date'],'game_id'=>$_GET['game_id'],'game_name'=>$_GET['game_name'],'user_account'=>$_GET['user_account'],'user_nickname'=>$_GET['user_nickname'],'parent_id'=>$_GET['parent_id'],'root_id'=>$_GET['root_id'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
<if condition="$_GET['all'] neq 1">
<a class="sch-btn" href="{:U('Export/gameFinanceDetail',
array('count_date'=>$_GET['count_date'],'game_id'=>$_GET['game_id'],'game_name'=>$_GET['game_name'],'user_account'=>$_GET['user_account'],'user_nickname'=>$_GET['user_nickname'],'parent_id'=>$_GET['parent_id'],'root_id'=>$_GET['root_id'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</if>
</div>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/>
<input type="hidden" name="game_id" value="{$_GET['game_id']}"/>

@ -136,18 +136,19 @@
<volist name="list_data" id="data">
<tr>
<td >
<if condition="$data.promote_id1 gt 0">
{$data['promote_account']}
<!-- <if condition="$data.promote_id1 gt 0">
{:get_promote_account($data['promote_id1'])}
<else/>
其他注册
</if>
</if> -->
</td>
<td ><span class='ljzc' data-value="{$data['promote_id']}"><a>{$data.count}</a></span></td>
<td ><span class='ljzc' data-value="{$data['id']}"><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>
<td >{$data.week}</td>
<td >{$data.mounth}</td>
<input type="hidden" id="promote_id" value="{$data['promote_id']}">
<input type="hidden" id="promote_id" value="{$data['id']}">
</tr>
</volist>
</empty>

@ -119,7 +119,7 @@
<else />
<volist name="list_data" id="data">
<tr>
<td >{:get_promote_name($data['promote_id1'])}</td>
<td >{$data['promote_account']}</td>
<td ><span class='ljcz' data-value='{$data["promote_id"]}'><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>

@ -31,6 +31,23 @@
<input type="text" class="" name="title" value="{$data.title|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">平台</td>
<td class="r table_radio">
<span class="form_select">
<select name="menu_version">
<foreach name="menu_version" item="vo" key="k">
<if condition="$data['menu_version'] == $k">
<option value="{$k}" selected="selected">{$vo}</option>
<else />
<option value="{$k}">{$vo}</option>
</if>
</foreach>
</select>
</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">菜单链接</td>
<td class="r table_radio">

@ -35,6 +35,7 @@
<th style="text-align:center">ID</th>
<th style="text-align:center">菜单名称</th>
<th style="text-align:center">菜单标题</th>
<th style="text-align:center">平台</th>
<th style="text-align:center">菜单图标</th>
<th style="text-align:center">菜单链接</th>
<th style="text-align:center">url类型</th>
@ -52,6 +53,7 @@
<td>{$channel.id}</td>
<td>{$channel.name}</td>
<td>{$channel.title}</td>
<td>{$channel.menu_version}</td>
<td><img src="{$channel.icon}"></td>
<td>{$channel.url}</td>
<td>{$channel.type}</td>

@ -1389,3 +1389,26 @@ function curl_post($url = '', $post_data = array()) {
return $data;
}
if(!function_exists('dd')){
function dd($var){
if (func_num_args() > 1) {
$var = func_get_args();
}
$debug = debug_backtrace();
echo '<pre class="yun-debug" style="background:#EAEAEA;padding:10px;">';
echo '<div class="file" style="color:#f00;">',$debug[0]['file'],' ',$debug[0]['line'],PHP_EOL,'</div>';
if (is_object($var) || is_array($var)) {
$mode = 0;
} else {
$mode = 1;
}
switch($mode){
case 0: print_r($var); break;
case 1: var_dump($var); break;
default: print_r($var);
}
echo '</pre>';
exit;
}
}

@ -1 +1 @@
# 数据备份文件夹,请勿删除
# 数据备份文件夹,请勿删除

@ -250,11 +250,31 @@ CREATE TABLE `tab_spend_month_count` (
ALTER TABLE `sys_file`
MODIFY COLUMN `name` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '原始文件名' AFTER `id`;
-- 2019-11-04 chenzhi
ALTER TABLE `tab_spend_month_count`
MODIFY COLUMN `balance_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '平台币游戏支付流水' AFTER `cash_count`,
ADD COLUMN `balance_coin_deposit` decimal(10,2) NULL DEFAULT 0.00 COMMENT '平台币充值流水' AFTER `balance_coin_count`;
--downloadlog
DROP TABLE IF EXISTS `tab_downloadlog`;
CREATE TABLE IF NOT EXISTS `tab_downloadlog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`logid` varchar(254) NOT NULL DEFAULT '0' COMMENT '日志id',
`admin_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广者|管理员id',
`type` varchar(254) NOT NULL DEFAULT '0' COMMENT '下载控制器地址',
`dataname` varchar(254) NOT NULL DEFAULT '0' COMMENT '导出数据名称',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '下载状态 0未下载 1已下载',
`addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加下载时间戳',
`begintime` int(11) NOT NULL DEFAULT '0' COMMENT '开始下载时间戳',
`content` mediumtext COMMENT '备注内容',
`conditions` varchar(1024) DEFAULT '[]' COMMENT '下载筛选条件',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=220 DEFAULT CHARSET=utf8 COMMENT='下载管理日志';
ALTER TABLE `tab_promote`
ADD COLUMN `ver_status` TINYINT(2) NULL DEFAULT NULL COMMENT '资质认证审核状态(1是审核成功2审核失败3未审核)' AFTER `child_game_permission`,
ADD COLUMN `idcarpic` CHAR(253) NULL DEFAULT NULL COMMENT '身份证证件照' AFTER `ver_status`,
ADD COLUMN `businesspic` CHAR(253) NULL DEFAULT NULL COMMENT '营业执照' AFTER `idcarpic`,
ADD COLUMN `agreementpic` CHAR(253) NULL DEFAULT NULL COMMENT '合同' AFTER `businesspic`,
ADD COLUMN `address` VARCHAR(520) NULL DEFAULT NULL COMMENT '住址' AFTER `agreementpic`,
ADD COLUMN `account_type` INT(11) NULL DEFAULT NULL COMMENT '(1为公司2为个人)' AFTER `address`;
-- 2019-11-06 chenzhi
DROP TABLE IF EXISTS `tab_spend_count`;
CREATE TABLE `tab_spend_count` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
@ -280,6 +300,21 @@ CREATE TABLE `tab_spend_count` (
KEY `count_date` (`count_date`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='游戏流水聚合表';
DROP TABLE IF EXISTS `tab_spend_month_count`;
CREATE TABLE `tab_spend_month_count` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`cash_count` decimal(10,2) DEFAULT '0.00' COMMENT '现金流水',
`balance_coin_count` decimal(10,2) DEFAULT '0.00' COMMENT '平台币游戏支付流水',
`balance_coin_deposit` decimal(10,2) DEFAULT '0.00' COMMENT '平台币充值流水',
`bind_coin_count` decimal(10,2) DEFAULT '0.00' COMMENT '绑币消耗',
`inside_cash_count` decimal(10,2) DEFAULT '0.00' COMMENT '内充流水',
`all_count` decimal(10,2) DEFAULT '0.00' COMMENT '流水和',
`count_date` varchar(30) DEFAULT '' COMMENT '统计月份',
`create_time` int(11) DEFAULT NULL COMMENT '添加时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `count_date` (`count_date`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='流水月份聚合表';
DROP TABLE IF EXISTS `tab_spend_user_count`;
CREATE TABLE `tab_spend_user_count` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
@ -289,6 +324,7 @@ CREATE TABLE `tab_spend_user_count` (
`level` tinyint(1) NOT NULL DEFAULT '0' COMMENT '推广员级别',
`cash_count` decimal(10,2) DEFAULT '0.00' COMMENT '现金流水',
`balance_coin_count` decimal(10,2) DEFAULT '0.00' COMMENT '平台币流水',
`bind_coin_count` decimal(10,2) DEFAULT '0.00' COMMENT '绑定币消耗',
`inside_cash_count` decimal(10,2) DEFAULT '0.00' COMMENT '内充流水',
`all_count` decimal(10,2) DEFAULT '0.00' COMMENT '流水和',
`count_date` varchar(30) DEFAULT '' COMMENT '统计月份',
@ -300,26 +336,3 @@ CREATE TABLE `tab_spend_user_count` (
KEY `count_date` (`count_date`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='流水角色聚合表';
--downloadlog
DROP TABLE IF EXISTS `tab_downloadlog`;
CREATE TABLE IF NOT EXISTS `tab_downloadlog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`logid` varchar(254) NOT NULL DEFAULT '0' COMMENT '日志id',
`admin_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广者|管理员id',
`type` varchar(254) NOT NULL DEFAULT '0' COMMENT '下载控制器地址',
`dataname` varchar(254) NOT NULL DEFAULT '0' COMMENT '导出数据名称',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '下载状态 0未下载 1已下载',
`addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加下载时间戳',
`begintime` int(11) NOT NULL DEFAULT '0' COMMENT '开始下载时间戳',
`content` mediumtext COMMENT '备注内容',
`conditions` varchar(1024) DEFAULT '[]' COMMENT '下载筛选条件',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=220 DEFAULT CHARSET=utf8 COMMENT='下载管理日志';
ALTER TABLE `tab_promote`
ADD COLUMN `ver_status` TINYINT(2) NULL DEFAULT NULL COMMENT '资质认证审核状态(1是审核成功2审核失败3未审核)' AFTER `child_game_permission`,
ADD COLUMN `idcarpic` CHAR(253) NULL DEFAULT NULL COMMENT '身份证证件照' AFTER `ver_status`,
ADD COLUMN `businesspic` CHAR(253) NULL DEFAULT NULL COMMENT '营业执照' AFTER `idcarpic`,
ADD COLUMN `agreementpic` CHAR(253) NULL DEFAULT NULL COMMENT '合同' AFTER `businesspic`,
ADD COLUMN `address` VARCHAR(520) NULL DEFAULT NULL COMMENT '住址' AFTER `agreementpic`,
ADD COLUMN `account_type` INT(11) NULL DEFAULT NULL COMMENT '(1为公司2为个人)' AFTER `address`;

@ -0,0 +1,43 @@
.collaborate_swiper{
margin-top: 0.02rem;
width: 100%;
height: 5rem;
}
.collaborate_swiper>img{
width: 100%;
height: 100%;
}
.collaborate_introduce{
padding: 0.7rem 3.6rem 0.8rem;
background-color: #F6F7FB;
}
.collaborate_info{
}
.collaborate_info .title{
padding: 0.11rem 0 0.11rem 0.27rem;
border-left: 0.05rem solid #2BBDEE;
font-size: 0.28rem;
color: #292929;
}
.collaborate_info .del{
margin: 0.29rem 0;
font-size: 0.24rem;
color: #292929;
font-weight: 300;
}
.collaborate_info>p{
font-size: 0.24rem;
color: #292929;
font-weight: 300;
margin-bottom: 0.1rem;
}
.map-box{
width: 100%;
height: 4.08rem;
margin-top: 0.81rem;
}
#container{
width: 100%;
height: 100%;
}

@ -0,0 +1,80 @@
.foot{
}
.foot_box{
padding: 0.37rem 3.61rem 0.31rem 3.59rem;
background-color: #282B2D;
}
.foot_top{
display: flex;
align-items: center;
padding-bottom: 0.2rem;
border-bottom: 1px solid #fff;
}
.foot_top>img{
width: 0.84rem;
height: 1.06rem;
}
.foot_top_ri{
margin-left: 0.39rem;
padding-left: 0.3rem;
border-left: 1px dashed #F5F5F5;
}
.foot_link{
display: flex;
align-items: center;
}
.foot_link>a{
font-size: 0.14rem;
color: #fff;
cursor: pointer;
}
.foot_link>a:first-child{
padding-right: 0.19rem;
border-right: 1px solid #fff;
margin-right: 0.2rem;
}
.foot_serial{
margin-top: 0.2rem;
display: flex;
align-items: center;
}
.foot_serial>span{
font-size: 0.12rem;
color: #fff;
}
.foot_serial>span:first-child{
margin-right: 0.44rem;
}
.foot_code{
margin-top: 0.11rem;
font-size: 0.12rem;
color: #fff;
}
.foot_approve{
margin-top: 0.14rem;
width: 0.68rem;
height: 0.24rem;
font-size: 0.12rem;
}
.foot_approve>img{
width: 100%;
height: 100%;
}
.foot_bom{
margin-top: 0.15rem;
text-align: center;
font-size: 0.14rem;
color: #D5D4D4;
}
.side_tabbar{
position: fixed;
right: 0.63rem;
top: 4.23rem;
width: 2.70rem;
height: 3.70rem;
}
.side_tabbar img{
width: 100%;
height: 100%;
}

@ -0,0 +1,47 @@
.heard{
width: 100%;
height: 1.5rem;
display: flex;
justify-content: center;
position: relative;
}
.heard_logo{
position: absolute;
left: 0.66rem;
top: 0.45rem;
width: 2.10rem;
height: 0.6rem;
font-size: 0.24rem;
}
.heard_logo>img{
width: 100%;
height: 100%;
}
.heard_tabbar ul{
display: flex;
font-size: 0.24rem;
color: #5B5B5B;
margin-top: 0.54rem;
}
.heard_tabbar ul li{
margin-right: 1.2rem;
cursor: pointer;
}
.heard_tabbar ul li a{
font-size: 0.28rem;
color: #5B5B5B;
padding-bottom: 0.54rem;
border-bottom: 0.04rem solid #fff;
}
.heard_tabbar ul li a:hover{
color: #2BBDEE;
border-bottom: 0.04rem solid #2BBDEE;
}
.heard_tabbar ul li .active{
color: #2BBDEE;
border-bottom: 0.04rem solid #2BBDEE;
}
.heard_tabbar ul li:last-child{
margin-right: 0;
}

@ -0,0 +1,126 @@
.product_swiper{
margin-top: 0.02rem;
width: 100%;
height: 2.9rem;
}
.product_swiper>img{
width: 100%;
height: 100%;
}
.product_home{
padding: 0.7rem 3.6rem 0.81rem 0.55rem;
background-color: #F6F7FB;
display: flex;
align-items: flex-start;
}
.product_left{
width: 2.5rem;
}
.product_left>img{
width: 2.5rem;
height: 1.38rem;
}
.recharge{
margin-top: 0.3rem;
background-color: #fff;
}
.recharge_box{
padding: 0 0.15rem;
padding-bottom: 0.34rem;
}
.recharge_box .title{
font-size: 0.28rem;
color: #949494;
text-align: center;
padding: 0.2rem 0;
border-bottom: 1px solid #EEEEEE;
}
.recharge_box .del{
font-size: 0.2rem;
color: #949494;
padding: 0.25rem 0.12rem 0.31rem 0.2rem;
}
.recharge_box .voucher{
font-size: 0.2rem;
color: #fff;
width: 1.5rem;
height: 0.4rem;
background-color: rgba(43,189,238,1);
border-radius: 0.2rem;
text-align: center;
line-height: 0.4rem;
margin: 0 auto;
cursor:pointer;
}
.product_right{
margin-left: 0.55rem;
}
.product_right .title{
padding: 0.12rem 0 0.12rem 0.27rem;
border-left: 0.05rem solid #2BBDEE;
font-size: 0.28rem;
color: #292929;
}
.not_product{
width: 12rem;
margin-top: 0.26rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.not_product>img{
width: 7.2rem;
height: 4rem;
}
.not_product>div{
color: #A9A9A9;
font-size: 0.28rem;
margin-top: 0.16rem;
}
.have_product{
margin-top: 0.3rem;
}
.have_product ul{
display: flex;
align-items: center;
flex-wrap: wrap;
}
.have_product ul li{
background-color: #fff;
width: 3.8rem;
margin-right: 0.2rem;
margin-bottom: 0.3rem;
}
.have_product ul li:nth-child(3n){
margin-right: 0;
}
.have_product ul li>img{
width: 3.8rem;
height: 2.14rem;
}
.have_product ul li .have_product_box{
padding: 0.3rem 0.33rem 0.07rem;
}
.have_product ul li .have_product_box .name{
font-size: 0.24rem;
color: #002929;
font-weight: 600;
}
.have_product ul li .have_product_box .del{
font-size: 0.16rem;
color: #A9A9A9;
margin-top: 0.33rem;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
padding-bottom: 0.3rem;
border-bottom: 1px solid #F6F7FB;
}
.have_product ul li .have_product_box .enter{
font-size: 0.16rem;
color: #A9A9A9;
text-align: right;
margin-top: 0.1rem;
cursor: pointer;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -0,0 +1,70 @@
$(function() {
// 百度地图API功能
var mp = new BMap.Map("container", {
enableMapClick: false
});
var addPoint = new BMap.Point(119.280631, 26.08057);
var marker = new BMap.Marker(addPoint); // 创建标注
mp.addOverlay(marker); // 将标注添加到地图中
mp.centerAndZoom(addPoint, 15);
mp.enableScrollWheelZoom();
// 复杂的自定义覆盖物
function ComplexCustomOverlay(point, text) {
this._point = point;
this._text = text;
}
ComplexCustomOverlay.prototype = new BMap.Overlay();
ComplexCustomOverlay.prototype.initialize = function(map) {
this._map = map;
var div = this._div = document.createElement("div");
div.style.position = "absolute";
div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
// div.style.border = "0.01rem solid #BC3B3A";
// div.style.backgroundColor = "#ffffff";
div.style.padding = "0.02rem";
div.style.height = "0.18rem";
div.style.width = "3rem";
// div.style.lineHeight = "0.18rem";
// div.style.whiteSpace = "nowrap";
div.style.MozUserSelect = "none";
div.style.fontSize = "0.18rem"
var p = this._span = document.createElement("p");
p.style.position = "absolute";
p.style.top = "-450%";
p.style.left = "-50%";
p.style.width = "3rem";
p.style.backgroundColor = "#ffffff";
p.style.lineHeight = "0.3rem";
p.style.textAlign = "center";
div.appendChild(p);
p.appendChild(document.createTextNode(this._text));
var that = this;
var arrow = this._arrow = document.createElement("div");
arrow.style.background = "url(../images/address-point.png) center no-repeat";
arrow.style.backgroundSize = "120% 120%";
arrow.style.position = "absolute";
arrow.style.width = "0.3rem";
arrow.style.height = "0.3rem";
arrow.style.top = "-80%";
arrow.style.left = "-8%";
arrow.style.overflow = "hidden";
div.appendChild(arrow);
mp.getPanes().labelPane.appendChild(div);
return div;
}
ComplexCustomOverlay.prototype.draw = function() {
var map = this._map;
var pixel = map.pointToOverlayPixel(this._point);
this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
this._div.style.top = pixel.y - 30 + "px";
}
var myCompOverlay = new ComplexCustomOverlay(addPoint, "福建省福州市鼓楼区福大怡山文化创意园11号楼");
mp.addOverlay(myCompOverlay);
});

@ -0,0 +1,34 @@
(function(doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function() {
var clientWidth = docEl.clientWidth;
if(!clientWidth) return;
if(clientWidth > 1080) {
var whdef = 100 / 1920; // 表示1920的设计图,使用100PX的默认值
var wH = window.innerHeight; // 当前窗口的高度
var wW = window.innerWidth; // 当前窗口的宽度
var rem = wW * whdef; // 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
docEl.style.fontSize = rem + "px";
} else if(640 < clientWidth <= 1080) {
docEl.style.fontSize = '50px';
} else {
docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
}
};
if(!doc.addEventListener) return;
recalc();
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
/*DOMContentLoaded文档加载完成不包含图片资源 onload包含图片资源*/
})(document, window);
/*
var iWidth=document.documentElement.clientWidth //getBoundingClientRect().width;
iWidth=iWidth>640?640:iWidth;
document.getElementsByTagName("html")[0].style.fontSize=iWidth/6.4+"px";*/
Loading…
Cancel
Save