Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
zhanglingsheng 5 years ago
commit 3b444155d8

@ -616,4 +616,62 @@ function encryptIdCard($str) {
$stars_str = "****";
}
return substr_replace($str, $stars_str, $length-4, 4);
}
//获取推广员资质审核状态 $type 1-获取数组 2-获取文本
function getPromoteVerStatus($status, $type = 1)
{
$statusList = [
0 => '未认证',
1 => '审核成功',
2 => '审核失败',
3 => '审核中',
4 => '修改审核中',
];
$records = null;
switch ($type) {
case 1:
$records = $status;
break;
case 2:
$records = $statusList[$status] ?? '未知';
break;
default:
$records = false;
break;
}
return $records;
}
//获取推广员账号
function getPromoteAccount($promoteId)
{
$map['id'] = intval($promoteId);
return M('promote', 'tab_')->where($map)->getField('account');
}
//获取推广员列表 $level 0-全部
function getPromoteByLevel($level = 0)
{
$field = 'id, account, real_name';
if ($level) {
$map['level'] = $level;
$promotes = M('promote', 'tab_')->field($field)->where($map)->select();
} else {
$promotes = M('promote', 'tab_')->field($field)->select();
}
return $promotes;
}
//获取游戏列表
function getAllGameList($groupByRelation = false)
{
$field = 'id, game_name, relation_game_id, relation_game_name';
if ($groupByRelation) {
$games = M('game', 'tab_')->field($field)->group('relation_game_id')->select();
} else {
$games = M('game', 'tab_')->field($field)->select();
}
return $games;
}

@ -2971,46 +2971,113 @@ class ExportController extends Controller
* ltv统计
* @author 鹿文学
*/
public function ltv($p=1) {
public function ltv($p=1, $start, $end) {
$xlsName = $_REQUEST['xlsname'];
$xlsCell = array(
array('time','日期'),
array('amount','充值金额'),
array('active','活跃用户'),
array('ltv1','LTV1'),
array('ltv2','LTV2'),
array('ltv3','LTV3'),
array('ltv4','LTV4'),
array('ltv5','LTV5'),
array('ltv6','LTV6'),
array('ltv7','LTV7'),
array('ltv14','LTV14'),
array('ltv30','LTV30'),
array('date','日期'),
array('total_amt','充值金额'),
array('user_count','活跃用户'),
array('ltv_1','LTV1'),
array('ltv_2','LTV2'),
array('ltv_3','LTV3'),
array('ltv_4','LTV4'),
array('ltv_5','LTV5'),
array('ltv_6','LTV6'),
array('ltv_7','LTV7'),
array('ltv_14','LTV14'),
array('ltv_30','LTV30'),
);
if (is_file(dirname(__FILE__).'/access_data_ltv.txt')) {
$filetxt = file_get_contents(dirname(__FILE__).'/access_data_ltv.txt');
$data = json_decode($filetxt,true);
} else {
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}//10;
$start = I('start',date('Y-m-d',strtotime('-30 day')));
$end = I('end',date('Y-m-d',strtotime('-1 day')));
$end = strtotime($end)>=strtotime(date('Y-m-d'))?date('Y-m-d',strtotime('-1 day')):$end;
$data = D('user')->ltv(strtotime($start),strtotime($end));
$start_time = $start = strtotime($start);
$end_time = $end = strtotime($end) + 86400;
$map = " 1=1 ";
if (isset($_REQUEST['game_name'])) {
$map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
}
if (isset($_REQUEST['server_name'])) {
$map .= " AND server_name = '{$_REQUEST['server_name']}' ";
}
}
// 获取包含的用户id
$users = M()->query("
SELECT
count(*) as total_count,
GROUP_CONCAT(u.id) as ids,
FROM_UNIXTIME(u.register_time, '%Y-%m-%d') as reg_date
FROM
tab_user u
WHERE
u.register_time BETWEEN {$start_time}
AND {$end_time}
GROUP BY reg_date
ORDER BY reg_date asc
");
$result = [];
foreach ($users as $index => $item) {
$ltv_start = strtotime($item['reg_date']);
$ltv_end = strtotime($item['reg_date']) + 30 * 86400;
$ltv = M()->query("
SELECT
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 1).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_1,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 2).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_2,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 3).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_3,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 4).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_4,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 5).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_5,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 6).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_6,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 7).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_7,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 14).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_14,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_30,
SUM(pay_amount) as total_amt
FROM
tab_spend
WHERE
{$map}
AND pay_time BETWEEN {$ltv_start}
AND {$ltv_end}
AND user_id IN ({$item['ids']}) AND pay_status = 1
");
$result[] = [
'date'=>$item['reg_date'],
'total_amt'=>$ltv[0]['total_amt'] ?: 0,
'user_count'=>$item['total_count'] ?: 0,
'ltv_1'=>$ltv[0]['ltv_1'] ?: 0,
'ltv_2'=>$ltv[0]['ltv_2'] ?: 0,
'ltv_3'=>$ltv[0]['ltv_3'] ?: 0,
'ltv_4'=>$ltv[0]['ltv_4'] ?: 0,
'ltv_5'=>$ltv[0]['ltv_5'] ?: 0,
'ltv_6'=>$ltv[0]['ltv_6'] ?: 0,
'ltv_7'=>$ltv[0]['ltv_7'] ?: 0,
'ltv_14'=>$ltv[0]['ltv_14'] ?: 0,
'ltv_30'=>$ltv[0]['ltv_30'] ?: 0
];
unset($user[$index]);
}
$data = [];
$k = 0;
for($i=$start_time; $i<$end_time; $i+=86400) {
if (($result[$k]['date'] == date("Y-m-d", $i))) {
$data[] = $result[$k];
$k += 1;
} else {
$data[] = [
'date'=>date("Y-m-d", $i),
'total_amt'=> 0,
'user_count'=> 0,
'ltv_1'=> 0,
'ltv_2'=> 0,
'ltv_3'=> 0,
'ltv_4'=> 0,
'ltv_5'=> 0,
'ltv_6'=> 0,
'ltv_7'=> 0,
'ltv_14'=> 0,
'ltv_30'=> 0
];
}
}
foreach ($data as $v) {
$xlsData[] = $v;

@ -6,11 +6,126 @@ use Think\Controller;
class PromoteGameRatioController extends ThinkController
{
const MODEL_NAME = 'promote_game_ratio';
const STATUS_REFUSE = -1;
const STATUS_WAIT = 0;
const STATUS_PASS = 1;
public static $statusList = [
self::STATUS_REFUSE => '审核未通过',
self::STATUS_WAIT => '待审核',
self::STATUS_PASS => '已审核',
];
public function lists()
{
$params = I('get.');
$promoteAccount = $params['promote_account'] ?? '';
$gameId = $params['game_id'] ?? 0;
$status = $params['status'] ?? '';
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
$map['_string'] = '1 = 1';
if ($promoteAccount) {
$promoteMap['account'] = trim($promoteAccount);
$promoteId = M('promote', 'tab_')->where($promoteMap)->getField('id');
$promoteId = $promoteId ?? 0;
$map['promote_id'] = $promoteId;
}
if ($gameId) {
$map['game_id'] = intval($gameId);
}
if ($status !== '') {
$map['status'] = intval($status);
}
$field = 'create_time, update_time';
$promoteGameRatios = D(self::MODEL_NAME)->field($field, true)
->where($map)
->page($page, $row)
->order('update_time desc, id desc')
->select();
$count = D(self::MODEL_NAME)->where($map)->count();
$records = [];
if ($promoteGameRatios) {
$promoteIds = array_column($promoteGameRatios, 'promote_id');
$gameIds = array_column($promoteGameRatios, 'game_id');
$promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status';
$gameFiled = 'id, game_name, ratio';
$promotes = M('promote', 'tab_')->where(array('id' => ['in', $promoteIds]))->getField($promoteFiled, true);
$games = M('game', 'tab_')->where(array('id' => ['in', $gameIds]))->getField($gameFiled, true);
foreach ($promoteGameRatios as $promoteGameRatio) {
$thisPromoteId = $promoteGameRatio['promote_id'];
$thisGameId = $promoteGameRatio['game_id'];
$issetPromote = isset($promotes[$thisPromoteId]);
$issetGame = isset($games[$thisGameId]);
$thisPromoteAccount = '未知';
$thisPromoteMobilePhone = '未知';
$thisPromoteCreateTime = '未知';
$thisPromoteStatus = '未知';
$thisPromoteVerStatus = '未知';
$thisGameName = '未知';
$thisGameRatio = '0.00';
$thisApplicant = getPromoteAccount($promoteGameRatio['applicant_id']);
$thisReviewer = $promoteGameRatio['reviewer_id'] ? getPromoteAccount($promoteGameRatio['reviewer_id']) : '待确认';
if ($promoteGameRatio['ratio'] > 0) {
$thisBeninTime = date('Y/m/d', $promoteGameRatio['begin_time']);
$thisEndTime = date('Y/m/d', $promoteGameRatio['end_time']);
} else {
$thisBeninTime = date('Y/m/d', $this->getPromoteApplyCreateTime($thisPromoteId, $thisGameId));
$thisEndTime = '永久';
}
$validDate = $thisBeninTime . ' - ' . $thisEndTime;
if ($issetPromote) {
$thisPromoteAccount = $promotes[$thisPromoteId]['account'];
$thisPromoteMobilePhone = $promotes[$thisPromoteId]['mobile_phone'];
$thisPromoteCreateTime = date('Y-m-d H:i:s', $promotes[$thisPromoteId]['create_time']);
$thisPromoteStatus = get_status_title($promotes[$thisPromoteId]['status']);
$thisPromoteStatus = $thisPromoteStatus ?? '未知';
$thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['status'], 2);
}
if ($issetGame) {
$thisGameName = $games[$thisGameId]['game_name'];
$thisGameRatio = $games[$thisGameId]['ratio'];
$thisGameRatio = $thisGameRatio ?? '0.00';
}
$records[] = [
'id' => $promoteGameRatio['id'],
'promote_id' => $promoteGameRatio['promote_id'],
'promote_account' => $thisPromoteAccount,
'promote_mobile_phone' => $thisPromoteMobilePhone,
'promote_create_time' => $thisPromoteCreateTime,
'promote_status_text' => $thisPromoteStatus,
'promote_ver_status_text' => $thisPromoteVerStatus,
'game_name' => $thisGameName,
'game_ratio' => $thisGameRatio . '%',
'ratio' => $promoteGameRatio['ratio'] . '%',
'valid_date' => $validDate,
'remark' => $promoteGameRatio['remark'],
'status_text' => self::$statusList[$promoteGameRatio['status']],
'applicant' => $thisApplicant ?? '未知',
'reviewer' => $thisReviewer ?? '未知',
];
}
}
$this->assign('records', $records);
$this->assign('count', $count);
$this->assign('gameList', getAllGameList());
$this->assign('promoteList', getPromoteByLevel(1));
$this->meta_title = '公会分成管理';
$this->display();
}
private function getPromoteApplyCreateTime($promoteId, $gameId)
{
$map['promote_id'] = $promoteId;
$map['game_id'] = $gameId;
$createTime = $apply = M('apply', 'tab_')->where($map)->getField('apply_time');
return $createTime;
}
}

@ -954,43 +954,146 @@ if ($payids) {
* @param integer $p 当前页
* @author 鹿文学
*/
public function ltv($p=1) {
// public function ltv($p=1) {
$page = intval($p);
// $page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
// $page = $page ? $page : 1; //默认显示第一页数据
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
// if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
$start = $_GET['start']= I('start',date('Y-m-d',strtotime('-30 day')));
// $start = $_GET['start']= I('start',date('Y-m-d',strtotime('-30 day')));
$end = I('end',date('Y-m-d',strtotime('-1 day')));
// $end = I('end',date('Y-m-d',strtotime('-1 day')));
$end = strtotime($end)>=strtotime(date('Y-m-d'))?date('Y-m-d',strtotime('-1 day')):$end;
// $end = strtotime($end)>=strtotime(date('Y-m-d'))?date('Y-m-d',strtotime('-1 day')):$end;
$_GET['end'] = $end;
// $_GET['end'] = $end;
$list = D('user')->ltv(strtotime($start),strtotime($end));
// $list = D('user')->ltv(strtotime($start),strtotime($end));
$count = count($list);
// $count = count($list);
$data = array_slice($list,($page-1)*$row,$row,true);
// $data = array_slice($list,($page-1)*$row,$row,true);
file_put_contents(dirname(__FILE__).'/access_data_ltv.txt',json_encode($list));
// file_put_contents(dirname(__FILE__).'/access_data_ltv.txt',json_encode($list));
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
// $page = set_pagination($count,$row);
// if($page) {$this->assign('_page', $page);}
// $this->meta_title = 'LTV统计';
// $this->assign('data',$data);
// $this->display();
// }
public function ltv($p=1, $row=10)
{
$start = I('start',date('Y-m-d',strtotime('-30 day')));
$end = I('end',date('Y-m-d',strtotime('-1 day')));
$start = strtotime($start);
$end = strtotime($end) + 86400;
$start_time = strtotime("+".(($p-1)*$row)." day", $start);
$end_time = strtotime("+".($p*$row+1)." day", $start);
$end_time = $end_time > $end ? $end : $end_time;
$map = " 1=1 ";
if (isset($_REQUEST['game_name'])) {
$map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
}
if (isset($_REQUEST['server_name'])) {
$map .= " AND server_name = '{$_REQUEST['server_name']}' ";
}
// 获取包含的用户id
$users = M()->query("
SELECT
count(*) as total_count,
GROUP_CONCAT(u.id) as ids,
FROM_UNIXTIME(u.register_time, '%Y-%m-%d') as reg_date
FROM
tab_user u
WHERE
u.register_time BETWEEN {$start_time}
AND {$end_time}
GROUP BY reg_date
ORDER BY reg_date asc
");
$result = [];
foreach ($users as $index => $item) {
$ltv_start = strtotime($item['reg_date']);
$ltv_end = strtotime($item['reg_date']) + 30 * 86400;
$ltv = M()->query("
SELECT
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 1).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_1,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 2).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_2,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 3).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_3,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 4).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_4,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 5).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_5,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 6).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_6,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 7).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_7,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 14).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_14,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_30,
SUM(pay_amount) as total_amt
FROM
tab_spend
WHERE
{$map}
AND pay_time BETWEEN {$ltv_start}
AND {$ltv_end}
AND user_id IN ({$item['ids']}) AND pay_status = 1
");
$result[] = [
'date'=>$item['reg_date'],
'total_amt'=>$ltv[0]['total_amt'] ?: 0,
'user_count'=>$item['total_count'] ?: 0,
'ltv_1'=>$ltv[0]['ltv_1'] ?: 0,
'ltv_2'=>$ltv[0]['ltv_2'] ?: 0,
'ltv_3'=>$ltv[0]['ltv_3'] ?: 0,
'ltv_4'=>$ltv[0]['ltv_4'] ?: 0,
'ltv_5'=>$ltv[0]['ltv_5'] ?: 0,
'ltv_6'=>$ltv[0]['ltv_6'] ?: 0,
'ltv_7'=>$ltv[0]['ltv_7'] ?: 0,
'ltv_14'=>$ltv[0]['ltv_14'] ?: 0,
'ltv_30'=>$ltv[0]['ltv_30'] ?: 0
];
unset($user[$index]);
}
$data = [];
$k = 0;
for($i=$start_time; $i<$end_time; $i+=86400) {
if (($result[$k]['date'] == date("Y-m-d", $i))) {
$data[] = $result[$k];
$k += 1;
} else {
$data[] = [
'date'=>date("Y-m-d", $i),
'total_amt'=> 0,
'user_count'=> 0,
'ltv_1'=> 0,
'ltv_2'=> 0,
'ltv_3'=> 0,
'ltv_4'=> 0,
'ltv_5'=> 0,
'ltv_6'=> 0,
'ltv_7'=> 0,
'ltv_14'=> 0,
'ltv_30'=> 0
];
}
}
$count = ($end-$start)/86400;
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = 'LTV统计';
$this->assign('data',$data);
$this->display();
$this->display('ltv');
}
}

@ -1 +1 @@
{"news":[{"time":"0:00","count":6},{"time":"1:00","count":9},{"time":"2:00","count":7},{"time":"3:00","count":11},{"time":"4:00","count":16},{"time":"5:00","count":7},{"time":"6:00","count":9},{"time":"7:00","count":11},{"time":"8:00","count":14},{"time":"9:00","count":40},{"time":"10:00","count":58},{"time":"11:00","count":86},{"time":"12:00","count":41},{"time":"13:00","count":55},{"time":"14:00","count":194},{"time":"15:00","count":180},{"time":"16:00","count":121},{"time":"17:00","count":98},{"time":"18:00","count":120},{"time":"19:00","count":147},{"time":"20:00","count":146},{"time":"21:00","count":124},{"time":"22:00","count":93},{"time":"23:00","count":56}],"sum":{"news":1649,"active":8210,"player":1715,"money":226618},"active":[{"time":"0:00","count":967},{"time":"1:00","count":343},{"time":"2:00","count":176},{"time":"3:00","count":135},{"time":"4:00","count":118},{"time":"5:00","count":177},{"time":"6:00","count":465},{"time":"7:00","count":661},{"time":"8:00","count":622},{"time":"9:00","count":547},{"time":"10:00","count":480},{"time":"11:00","count":414},{"time":"12:00","count":326},{"time":"13:00","count":237},{"time":"14:00","count":354},{"time":"15:00","count":328},{"time":"16:00","count":215},{"time":"17:00","count":219},{"time":"18:00","count":256},{"time":"19:00","count":335},{"time":"20:00","count":274},{"time":"21:00","count":244},{"time":"22:00","count":197},{"time":"23:00","count":120}],"player":[{"time":"0:00","count":211},{"time":"1:00","count":84},{"time":"2:00","count":29},{"time":"3:00","count":25},{"time":"4:00","count":16},{"time":"5:00","count":24},{"time":"6:00","count":32},{"time":"7:00","count":56},{"time":"8:00","count":71},{"time":"9:00","count":66},{"time":"10:00","count":63},{"time":"11:00","count":69},{"time":"12:00","count":58},{"time":"13:00","count":62},{"time":"14:00","count":50},{"time":"15:00","count":99},{"time":"16:00","count":68},{"time":"17:00","count":61},{"time":"18:00","count":77},{"time":"19:00","count":157},{"time":"20:00","count":107},{"time":"21:00","count":101},{"time":"22:00","count":74},{"time":"23:00","count":55}],"money":[{"time":"0:00","count":"31554.00"},{"time":"1:00","count":"4117.00"},{"time":"2:00","count":"1839.00"},{"time":"3:00","count":"4513.00"},{"time":"4:00","count":"1008.00"},{"time":"5:00","count":"1981.00"},{"time":"6:00","count":"1270.00"},{"time":"7:00","count":"1906.00"},{"time":"8:00","count":"6683.00"},{"time":"9:00","count":"6119.00"},{"time":"10:00","count":"8974.00"},{"time":"11:00","count":"14147.00"},{"time":"12:00","count":"9775.00"},{"time":"13:00","count":"11908.00"},{"time":"14:00","count":"6781.00"},{"time":"15:00","count":"12626.00"},{"time":"16:00","count":"6742.00"},{"time":"17:00","count":"8303.00"},{"time":"18:00","count":"8804.00"},{"time":"19:00","count":"23476.00"},{"time":"20:00","count":"17464.00"},{"time":"21:00","count":"16899.00"},{"time":"22:00","count":"13143.00"},{"time":"23:00","count":"6586.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":1},{"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":1},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":2,"active":13,"player":5,"money":1330.05},"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":3},{"time":"10:00","count":2},{"time":"11:00","count":2},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":1},{"time":"16:00","count":0},{"time":"17:00","count":1},{"time":"18:00","count":0},{"time":"19:00","count":2},{"time":"20:00","count":0},{"time":"21:00","count":1},{"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":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":1},{"time":"16:00","count":2},{"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":"962.00"},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":"356.00"},{"time":"15:00","count":"0.03"},{"time":"16:00","count":"12.02"},{"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}]}

@ -2,7 +2,10 @@
namespace Admin\Model;
class PromoteGameRatioModel
{
use Think\Model;
class PromoteGameRatioModel extends Model
{
// 数据表前缀
protected $tablePrefix = 'tab_';
}

@ -0,0 +1,415 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:此功能可设置所有公会对应的游戏分成比例。</p>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<empty name="show_status">
<a class=" " href="{:U('add?model='.$model['id'])}"><span class="button_icon button_icon1"></span>游戏分成比例申请</a>
<a class="ajax-post " target-form="ids" url="{:U('Promote/set_status',array('status'=>1,'msg_type'=>5,'field'=>'status'))}"><span class="button_icon button_icon9"></span>审核通过</a>
<a class="ajax-post " style="color: red;" target-form="ids" url="{:U('Promote/set_status',array('status'=>1,'msg_type'=>5,'field'=>'status'))}"><span class="button_icon button_icon9"></span>审核拒绝</a>
</empty>
</div>
</div>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" >
<option value="">推广员账号</option>
<volist name="promoteList" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}({$vo.real_name})</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
<volist name="gameList" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq I('game_id')">selected</if> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteGameRatio/lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>会长ID</th>
<th>会长账号</th>
<th>手机号码</th>
<th>注册时间</th>
<th>状态</th>
<th>身份状态</th>
<th>已申请游戏</th>
<th>原分成比例</th>
<th>当前分成比例</th>
<th>开始时间</th>
<th>备注</th>
<th>分成比例审核</th>
<th>申请人</th>
<th>确认人</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($records)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<volist name="records" id="record">
<tr>
<td><input class="ids" type="checkbox" value="{$record['id']}" name="ids[]"></td>
<td>{$record.promote_id}</td>
<td>{$record.promote_account}</td>
<td>{$record.promote_mobile_phone}</td>
<td>{$record.promote_create_time}</td>
<td>{$record.promote_status_text}</td>
<td>{$record.promote_ver_status_text}</td>
<td>{$record.game_name}</td>
<td>{$record.game_ratio}</td>
<td>{$record.ratio}</td>
<td>{$record.valid_date}</td>
<td>{$record.remark}</td>
<td>{$record.status_text}</td>
<td>{$record.applicant}</td>
<td>{$record.reviewer}</td>
<td>
<a href="{:U('edit', array('id'=>$record['id']))}" class="">修改</a>
</td>
</tr>
</volist>
</if>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>
{$_page|default=''}
</div>
<div class="pro_promot" style="display:none">
<form action="{:U('Promote/savePromoteGame')}" id="ajaxForm" method="post" />
<input type="hidden" name="promote_id" id="se_promote_id" value="" />
<div class="pro_promot_main">
<div class="pro_promot_title">
<div class="fl pro_promot_title_text">
<div class="fl pro_promot_title_bigtext"> 可申请游戏</div> 选中的游戏将在对应的推广员后台进行展示,推广员可进行游戏申请</div>
<div class="pro_promot_close fr"><img src="__IMG__/icon_close.png"></div>
</div>
<div class="pro_promot_con">
<div class="pro_promot_account">推广员账号:<span class="pro_promot_number"></span></div>
<div class="pro_promot_select">
<div class="pro_promot_select_title fl">选择游戏:</div>
<div class="pro_promot_select_list fl">
<a class="pro_promot_select_list_con fl active pro_promot_all pro_promot_mr20">全部 </a>
<a class="pro_promot_select_list_con fl" data-index="A">A</a>
<a class="pro_promot_select_list_con fl" data-index="B">B</a>
<a class="pro_promot_select_list_con fl" data-index="C">C</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="D">D</a>
<a class="pro_promot_select_list_con fl" data-index="E">E</a>
<a class="pro_promot_select_list_con fl" data-index="F">F</a>
<a class="pro_promot_select_list_con fl" data-index="G">G</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="H">H</a>
<a class="pro_promot_select_list_con fl" data-index="I">I</a>
<a class="pro_promot_select_list_con fl" data-index="J">J</a>
<a class="pro_promot_select_list_con fl" data-index="K">K</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="L">L</a>
<a class="pro_promot_select_list_con fl" data-index="M">M</a>
<a class="pro_promot_select_list_con fl" data-index="N">N</a>
<a class="pro_promot_select_list_con fl" data-index="O">O</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="P">P</a>
<a class="pro_promot_select_list_con fl" data-index="Q">Q</a>
<a class="pro_promot_select_list_con fl" data-index="R">R</a>
<a class="pro_promot_select_list_con fl" data-index="S">S</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="T">T</a>
<a class="pro_promot_select_list_con fl" data-index="U">U</a>
<a class="pro_promot_select_list_con fl" data-index="V">V</a>
<a class="pro_promot_select_list_con fl" data-index="W">W</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="X">X</a>
<a class="pro_promot_select_list_con fl" data-index="Y">Y</a>
<a class="pro_promot_select_list_con fl" data-index="Z">Z</a>
</div>
</div>
<div class="clear"></div>
<div class="pro_promot_game">
<div class="jsgamecheckallbox z_clearfix" >
<label class="custom-label">
<input type="checkbox" checked="checked" class="form_control jsgamecheckall" >
<i class="label_icon"></i>
<span class="label_text">全选</span></label>
</div>
<ul id="game_list" class="z_clearfix game_list">
</ul>
</div>
<div class="clear"></div>
<div class="pro_promot_btn">
<div class="fl pro_promot_btn_confirm">确定</div>
<div class="fr pro_promot_btn_cancel">取消</div>
</div>
</div>
</div>
</form>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Promote/lists')}');
$(function(){
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$("#admin").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#admin #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#admin #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(text);
})
});
/* 状态搜索子菜单 */
/*渠道删除*/
$('.delete').click(function(){
var id = $(this).attr('data-id');
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
title:'确定要删除该渠道?',
icon:0,
btn: ['删除','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: "{:U('del_promote')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg(data.msg);
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}, function(){
layer.close();
});
})
})
</script>
<script type="text/javascript">
//点击字母按照条件按钮筛选
$(".pro_promot_select_list_con").click(function(){
//选中高亮样式
$(this).addClass('active');
$(this).siblings().removeClass('active');
var that = $(this);
var index = $(this).attr("data-index");
$("#game_list li").each(function(index,ele){
var short = $(this).attr('data-short');
$(this).show();
if(that.attr('data-index')){
if(that.attr('data-index')!=short.charAt(0)){
$(this).hide();
}
}
})
});
//打开弹窗
$(".ajax-view").click(function(){
//获取游戏列表
var url = "{:U('Promote/getPromoteGame')}";
var id = $(this).attr('data-id');
$.post(url,{id:id},function(res){
if(res.code==1){
$(".pro_promot_select_list a").eq(0).addClass('active');
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
var game_list = res.data.game_list;
var promote_info = res.data.promote_info;
var lis = [];
$.each(game_list,function(index,ele){
if(ele.game_name.length>6){
ele.game_name = ele.game_name .substring(0,6)+"..."
}
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
if(promote_info['game_ids']==''){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
if(promote_info['game_ids'].indexOf(ele.id)>-1){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
}
}
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
lis.push('</li>');
});
$("#game_list").html(lis.join(''));
$(".pro_promot_number").text(res.data.promote_info.account);
$("#se_promote_id").val(res.data.promote_info.id);
$(".pro_promot").css("display","block");
jsgameid();
}else{
alert('请求失败');
}
});
});
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
layer.msg(res.msg);
$(".pro_promot").hide();
});
return false;
});
//关闭弹窗
$(".pro_promot_close").click(function(){
$(".pro_promot").css("display","none");
});
//取消修改
$(".pro_promot_btn_cancel").click(function(){
$(".pro_promot").css("display","none");
layer.msg('修改已取消');
});
$(".jsgamecheckall").click(function(){
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
});
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
function jsgameid(){
$(".jsgameid").click(function(){
var option = $(this).closest('ul').find(".jsgameid"),
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
option.each(function(i){
if(!this.checked){
checkall.prop("checked", false);
return false;
}else{
checkall.prop("checked", true);
}
});
});
}
</script>
</block>

@ -6,7 +6,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">LTV统计</h3>
<p class="description_text">说明:计算用户生命周期价值的相关数据(充值金额统计用户在平台内/游戏内进行现金充值的数据汇总,游戏内通过平台币/绑币进行消费的计算在内 </p>
<p class="description_text">说明:计算用户生命周期价值的相关数据(充值金额统计用户在平台内/游戏内进行现金充值的数据汇总,游戏内通过平台币/绑币进行消费的计算在内 </p>
</div>
<div class="cf jssearch top_nav_list">
@ -20,7 +20,26 @@
&nbsp;-&nbsp;
<input type="text" id="time-end" name="end" class="" value="{:I('end',date('Y-m-d',strtotime('-1 day')))}" placeholder="选择结束时间" />
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <if condition="$vo.game_name eq I('game_name')">selected</if> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Statistics/ltv','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
@ -56,18 +75,18 @@
<else/>
<volist name="data" id="vo">
<tr>
<td>{$vo.time}</td>
<td>{$vo.amount}</td>
<td>{$vo.active}</td>
<td>{$vo.ltv1}</td>
<td>{$vo.ltv2}</td>
<td>{$vo.ltv3}</td>
<td>{$vo.ltv4}</td>
<td>{$vo.ltv5}</td>
<td>{$vo.ltv6}</td>
<td>{$vo.ltv7}</td>
<td>{$vo.ltv14}</td>
<td>{$vo.ltv30}</td>
<td>{$vo.date}</td>
<td>{$vo.total_amt}</td>
<td>{$vo.user_count}</td>
<td>{$vo.ltv_1}</td>
<td>{$vo.ltv_2}</td>
<td>{$vo.ltv_3}</td>
<td>{$vo.ltv_4}</td>
<td>{$vo.ltv_5}</td>
<td>{$vo.ltv_6}</td>
<td>{$vo.ltv_7}</td>
<td>{$vo.ltv_14}</td>
<td>{$vo.ltv_30}</td>
</tr>
</volist>
</empty>
@ -172,10 +191,33 @@ $(function(){
autoclose:1,endDate:new Date(new Date().getTime()-24*60*60*1000),
pickerPosition:'bottom-right'
});
var game_server = "{:I('server_name')}";
$("#game_type").change(function(){
console.log({sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()})
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
})
</script>

@ -32,7 +32,7 @@
<div class="fr">
</div>
<h3 class="page_title">扶持发放</h3>
<h3 class="page_title">资源发放</h3>
<p class="description_text">说明:记录所有扶持发放的数据</p>
@ -74,11 +74,11 @@
</select>
</div>
<div class="input-list">
<label>扶持类型:</label>
<label>资源类型:</label>
<select name="apply_type">
<option value="">全部</option>
<option value="0">新增扶持</option>
<option value="1">后续扶持</option>
<option value="0">新增资源</option>
<option value="1">后续资源</option>
</select>
</div>
<div class="input-list">
@ -111,7 +111,7 @@
<th>区服</th>
<th>角色名</th>
<th>申请额度</th>
<th>扶持类型</th>
<th>资源类型</th>
<th>备注</th>
<th>申请时间</th>
<th>可用额度</th>
@ -134,7 +134,7 @@
<td>{$data['server_name']}</td>
<td>{$data['role_name']}</td>
<td>{$data['apply_resource']}</td>
<td><if condition="$data.apply_type eq 0" >新增扶持<else/>后续扶持</if></td>
<td><if condition="$data.apply_type eq 0" >新增资源<else/>后续资源</if></td>
<td style="max-width: 200px;line-height: 1.5;padding:8px;">{$data['apply_remark']}</td>
<td>{:date('Y-m-d H:i:s',$data['create_time'])}</td>
@ -170,7 +170,7 @@
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/Support_list',array_merge(array('xlsname'=>'扶持发放'),I('get.')))}">导出</a>
<a class="sch-btn" href="{:U('Export/Support_list',array_merge(array('xlsname'=>'资源发放'),I('get.')))}">导出</a>
{$_page|default=''}
</div>
</block>

@ -33,11 +33,11 @@
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if> href="{:U('supportNumberList',array('type'=>1))}">扶持号管理</a>
<a <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if> href="{:U('supportNumberList',array('type'=>1))}">资源管理</a>
</div>
<h3 class="page_title">扶持号管理</h3>
<h3 class="page_title">资源管理</h3>
<if condition="(I('type',1) eq 1) ">
<p class="description_text">说明:此功能是扶持号管理<的功能</p>
<p class="description_text">说明:此功能是资源管理的功能</p>
<else/>
<p class="description_text">说明:此功是查看并管理混服申请的功能</p>
</if>
@ -101,7 +101,7 @@
<th>角色名称</th>
<th>设备信息</th>
<th>状态</th>
<th >创建时间</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>

@ -1201,7 +1201,7 @@ function getChildGameAddPermission($promoteId)
function gameSearch($relationGameId, $sdkVersion)
{
$map = '1 = 1';
$map['_string'] = '1 = 1';
if ($relationGameId != 0) {
$map['relation_game_id'] = $relationGameId;
}

@ -3178,7 +3178,7 @@ class DownloadController extends BaseController {
unset($map['costbegin']);
unset($map['costend']);
$nowTime = strtotime(date('Y-m-d 00:00:00', time()));
$subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$subMap['create_time'] = ['between', [$map['begintime'], $map['endtime']-1]];
if ($costBegin != '' || $costEnd != '') {
$having = '';
if ($costBegin != '' && $costEnd != '') {
@ -3196,35 +3196,43 @@ class DownloadController extends BaseController {
$map['_string'] = 'ui.role_id in (' . $subQuery . ')';
}
$secondDay = 24*3600 + 1;
$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - $secondDay]];
$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime']-1]];
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,ui.create_time";
$loginRecordMap['lr.create_time'] = $map['uc.create_time'];
$loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id';
$fieldLR = M('login_daily_record', 'tab_')->alias('lr')
->field("count(*) as count")
->where($loginRecordMap)
->buildSql();
$field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count';
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->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();
$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,uc.user_id";
$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,ui.create_time";
$loginRecordMap['lr.create_time'] = $map['uc.create_time'];
$loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id';
$fieldLR = M('login_daily_record', 'tab_')->alias('lr')
->field("count(*) as count")
->where($loginRecordMap)
->buildSql();
$field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count';
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->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();
$roles = M()->alias('record')
->table($subQuery)
->select();
$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();
$totalQuery = 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 uc.server_id = ui.server_id and ui.role_id = uc.role_id')
->group('uc.role_id,uc.game_id,uc.server_id,uc.user_id')
->where($map)
->buildSql();
$total = M()->alias('totals')
->table($totalQuery)
->field('sum(recharge_cost) recharge_cost,sum(recharge_count) recharge_count,sum(recharge_cost_today) as recharge_cost_today')
->find();
$userIds = array_column($roles, 'user_id');
$userIds = $userIds ?? [-1];
$users = M('user', 'tab_')->where(array('id' => ['in', $userIds]))->getField('id, account', true);
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
@ -3247,6 +3255,9 @@ class DownloadController extends BaseController {
->limit(($i-1)*$perSize ,$perSize)
->select();
foreach($data as $key => $value) {
if (empty($value['user_account']) ) {
$value['user_account'] = $users[$value['user_id']] ?? '';
}
$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'];

@ -1114,6 +1114,8 @@ class QueryController extends BaseController
$summaryData = [];
$dayList = $this->getDayList($begTime, $endTime);
$dayListReverse = $dayList;
$dayList = array_reverse($dayList);
$params['dayList'] = $dayList;
$records = [];
@ -1184,7 +1186,9 @@ class QueryController extends BaseController
$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);
}
foreach ($dayListReverse as $day) {
$date = date('Ymd', strtotime($day));
$summaryData['date'][] = $date;
$summaryData['role_num'][] = $roleNumList[$day];
$summaryData['user_num'][] = $userNumList[$day];
@ -1678,16 +1682,8 @@ class QueryController extends BaseController
}
if ($relationGameId != 0 || $sdkVersion != 0) {
if ($relationGameId != 0) {
$gameMap['relation_game_id'] = $relationGameId;
}
if ($sdkVersion != 0) {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
$gameId = $gameId ?? [];
$map['game_id'] = ['in', $gameId];
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
@ -1793,17 +1789,9 @@ class QueryController extends BaseController
$subMap = ['promote_id' => ['in', $ids]];
if ($relationGameId != 0 || $sdkVersion != 0) {
if ($relationGameId != 0) {
$gameMap['relation_game_id'] = $relationGameId;
}
if ($sdkVersion != 0) {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
$gameId = $gameId ?? [];
$map['uc.game_id'] = ['in', $gameId];
$subMap['game_id'] = ['in', $gameId];
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['uc.game_id'] = ['in', $gameIds];
$subMap['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['uc.server_id'] = $serverId;
@ -1873,9 +1861,9 @@ class QueryController extends BaseController
$field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count';
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->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.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.game_id,uc.user_id,uc.id')
->group('uc.role_id,uc.server_id,uc.game_id')
->buildSql();
$query = M()->alias('record')
->table($subQuery)
@ -1886,7 +1874,7 @@ class QueryController extends BaseController
$totalQuery = 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 uc.server_id = ui.server_id and ui.role_id = uc.role_id')
->group('uc.role_id,uc.game_id,uc.server_id,uc.user_id,uc.id')
->group('uc.role_id,uc.game_id,uc.server_id,uc.user_id')
->where($map)
->buildSql();
$total = M()->alias('totals')
@ -2081,16 +2069,8 @@ class QueryController extends BaseController
'basicPromotes' => $basicPromotes,
];
if ($relationGameId != 0 || $sdkVersion != 0) {
if ($relationGameId != 0) {
$gameMap['relation_game_id'] = $relationGameId;
}
if ($sdkVersion != 0) {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
$gameId = $gameId ?? [];
$params['game_id'] = ['in', $gameId];
$gameIds = gameSearch($relationGameId, $sdkVersion);
$params['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;

@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>隐私政策</title>
</head>
<body>
<h1>
隐私政策
</h1>
<p>
本应用尊重并保护所有使用服务用户的个人隐私权。为了给您提供更准确、更有个性化的服务,本应用会按照本隐私权政策的规定使用和披露您的个人信息。但本应用将以高度的勤勉、审慎义务对待这些信息。除本隐私权政策另有规定外,在未征得您事先许可的情况下,本应用不会将这些信息对外披露或向第三方提供。本应用会不时更新本隐私权政策。 您在同意本应用服务使用协议之时,即视为您已经同意本隐私权政策全部内容。本隐私权政策属于本应用服务使用协议不可分割的一部分。
</p>
<ol>
<li>
适用范围
<ol>
<li>
在您注册本应用帐号时,您根据本应用要求提供的个人注册信息;
</li>
<li>
在您使用本应用网络服务或访问本应用平台网页时本应用自动接收并记录的您的浏览器和计算机上的信息包括但不限于您的IP地址、浏览器的类型、使用的语言、访问日期和时间、软硬件特征信息及您需求的网页记录等数据
</li>
<li>
本应用通过合法途径从商业伙伴处取得的用户个人数据。
</li>
</ol>
您了解并同意,以下信息不适用本隐私权政策:
<ol>
<li>
您在使用本应用平台提供的搜索服务时输入的关键字信息;
</li>
<li>
本应用收集到的您在本应用发布的有关信息数据,包括但不限于参与活动、成交信息及评价详情;
</li>
<li>
违反法律规定或违反本应用规则行为及本应用已对您采取的措施。
</li>
</ol>
</li>
<li>
信息使用
<ol>
<li>
本应用不会向任何无关第三方提供、出售、出租、分享或交易您的个人信息,除非事先得到您的许可,或该第三方和本应用(含本应用关联公司)单独或共同为您提供服务,且在该服务结束后,其将被禁止访问包括其以前能够访问的所有这些资料。
</li>
<li>
本应用亦不允许任何第三方以任何手段收集、编辑、出售或者无偿传播您的个人信息。任何本应用平台用户如从事上述活动,一经发现,本应用有权立即终止与该用户的服务协议。
</li>
<li>
为服务用户的目的,本应用可能通过使用您的个人信息,向您提供您感兴趣的信息,包括但不限于向您发出产品和服务信息,或者与本应用合作伙伴共享信息以便他们向您发送有关其产品和服务的信息(后者需要您的事先同意)。
</li>
</ol>
</li>
<li>
信息披露<br>
在如下情况下,本应用将依据您的个人意愿或法律的规定全部或部分的披露您的个人信息:
<ol>
<li>
经您事先同意,向第三方披露;
</li>
<li>
为提供您所要求的产品和服务,而必须和第三方分享您的个人信息;
</li>
<li>
根据法律的有关规定,或者行政或司法机构的要求,向第三方或者行政、司法机构披露;
</li>
<li>
如您出现违反中国有关法律、法规或者本应用服务协议或相关规则的情况,需要向第三方披露;
</li>
<li>
如您是适格的知识产权投诉人并已提起投诉,应被投诉人要求,向被投诉人披露,以便双方处理可能的权利纠纷;
</li>
<li>
在本应用平台上创建的某一交易中,如交易任何一方履行或部分履行了交易义务并提出信息披露请求的,本应用有权决定向该用户提供其交易对方的联络方式等必要信息,以促成交易的完成或纠纷的解决。
</li>
<li>
其它本应用根据法律、法规或者网站政策认为合适的披露。
</li>
</ol>
</li>
<li>
信息存储和交换<br>
本应用收集的有关您的信息和资料将保存在本应用及(或)其关联公司的服务器上,这些信息和资料可能传送至您所在国家、地区或本应用收集信息和资料所在地的境外并在境外被访问、存储和展示。
</li>
<li>
Cookie的使用
<ol>
<li>
在您未拒绝接受cookies的情况下本应用会在您的计算机上设定或取用cookies 以便您能登录或使用依赖于cookies的本应用平台服务或功能。本应用使用cookies可为您提供更加周到的个性化服务包括推广服务。
</li>
<li>
您有权选择接受或拒绝接受cookies。您可以通过修改浏览器设置的方式拒绝接受cookies。但如果您选择拒绝接受cookies则您可能无法登录或使用依赖于cookies的本应用网络服务或功能。
</li>
<li>
通过本应用所设cookies所取得的有关信息将适用本政策。
</li>
</ol>
</li>
<li>
信息安全
<ol>
<li>
本应用帐号均有安全保护功能,请妥善保管您的用户名及密码信息。本应用将通过对用户密码进行加密等安全措施确保您的信息不丢失,不被滥用和变造。尽管有前述安全措施,但同时也请您注意在信息网络上不存在“完善的安全措施”。
</li>
<li>
在使用本应用网络服务进行网上交易时,您不可避免的要向交易对方或潜在的交易对
</li>
</ol>
</li>
<li>
本隐私政策的更改
<ol>
<li>
如果决定更改隐私政策,我们会在本政策中、本公司网站中以及我们认为适当的位置发布这些更改,以便您了解我们如何收集、使用您的个人信息,哪些人可以访问这些信息,以及在什么情况下我们会透露这些信息。
</li>
<li>
本公司保留随时修改本政策的权利,因此请经常查看。如对本政策作出重大更改,本公司会通过网站通知的形式告知。
</li>
</ol>
</li>
</ol>
</body></html>
Loading…
Cancel
Save