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

master
ELF 5 years ago
commit d5b5e6162e

@ -1044,6 +1044,11 @@ function get_promote_coin($promote_id){
$promote = M('promote','tab_')->field('balance_coin')->find($promote_id);
return $promote['balance_coin'];
}
function intFun($v)
{
$v=(int)$v;
return $v;
}
/**
* 获取渠道父类

@ -891,9 +891,13 @@ public function auto_rrdae(){
}
//根据时间统计玩家充值
public function userPlayDataCount()
public function userPlayDataCount($time = '')
{
$time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24)));
if ($time == '') {
$time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24)));
} else {
$time = strtotime(date('Y-m-d 00:00:00', strtotime($time)));
}
$res = M('user_play_data_count', 'tab_')->where(array('create_time' => $time))->find();
if (empty($res)) {
$map['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];

@ -94,9 +94,10 @@ class ConsoleController extends Think {
$this->modifyLogin(1569686400);
}
public function modifyLoginGenerate()
public function modifyLoginGenerate($start_time=0)
{
$this->modifyLogin(strtotime(date("Y-m-d"))-86400);
$start_time = $start_time ? $start_time : date('Y-m-d', strtotime('-1 day'));
$this->modifyLogin(strtotime($start_time));
}
/**

@ -1,5 +1,5 @@
<?php
namespace admin\Controller;
namespace Admin\Controller;
use Think\Controller;
@ -213,10 +213,10 @@ class ExportController extends Controller
// array('register_ip', L('Register_iP')),
// array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
// );
$field = 'tab_user.id,tab_user.register_type,tab_user.account,tab_user.promote_account,tab_user.balance
,IFNULL(sum(ss.pay_amount),0) AS recharge_total,tab_user.gold_coin,tab_user.alipay,tab_user.id as small_count,
tab_user.id as vip_level,register_time,tab_user.login_time,tab_user.register_ip,tab_user.lock_status,
tab_user.age_status,tab_user.register_way';
$field = 'a.id,a.register_type,a.account,a.promote_account,a.balance
,IFNULL(sum(ss.pay_amount),0) AS recharge_total,a.gold_coin,a.alipay,a.id as small_count,
a.id as vip_level,register_time,a.login_time,a.register_ip,a.lock_status,
a.age_status,a.register_way';
$xlsCell = [L('Account_number_ID'),L('Third_party_source'),"玩家账号",L('Subordinate_channel'), "账户平台币"
, "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", L('Registration_time'), "最后登录时间", L('Register_iP'), L('Account_status')];
$map['tab_user.register_type']= ['in','3,4,5,6'];
@ -237,10 +237,10 @@ class ExportController extends Controller
// array('register_ip', L('Register_iP')),
// array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
// );
$field = 'tab_user.id,tab_user.account,tab_user.promote_account,tab_user.balance,
IFNULL(sum(ss.pay_amount),0) AS recharge_total,tab_user.gold_coin,tab_user.alipay
,tab_user.id as small_count,tab_user.id as vip_level,tab_user.register_type,register_time,tab_user.login_time
,tab_user.register_ip,tab_user.lock_status,tab_user.age_status,tab_user.register_way';
$field = 'a.id,a.account,a.promote_account,a.balance,
IFNULL(sum(ss.pay_amount),0) AS recharge_total,a.gold_coin,a.alipay
,a.id as small_count,a.id as vip_level,a.register_type,register_time,a.login_time
,a.register_ip,a.lock_status,a.age_status,a.register_way';
$xlsCell = [L('Account_number_ID'),"玩家账号",L('Subordinate_channel'), "账户平台币"
, "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", "注册方式", L('Registration_time'),
"最后登录时间", L('Register_iP'), L('Account_status')];
@ -248,77 +248,175 @@ class ExportController extends Controller
$map['tab_user.register_type']=['in','0,1,2,7'];
}
if (isset($_REQUEST['user_id'])) {
$map['tab_user.id'] = $_REQUEST['user_id'];
unset($_REQUEST['user_id']);
}
if (isset($_REQUEST['device_number'])) {
$map['tab_user.device_number'] = $_REQUEST['device_number'];
unset($_REQUEST['device_number']);
}
$hav = '';
if ($_REQUEST['promote_id'] != '') {
if($_REQUEST['promote_id']=='UC'){
$map['tab_user.promote_account'] = 'UC用户';
$maps['tab_user.promote_account'] = 'UC用户';
$hav .= "tab_user.promote_account = 'UC用户' ";
} else if ($_REQUEST['promote_id']==0) {
$map['tab_user.promote_id'] = 0;
$maps['tab_user.promote_id'] = 0;
$hav .= "tab_user.promote_id = 0";
} else{
$promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select();
if ($promoter_ids) {
$map['tab_user.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
$hav .= "tab_user.promote_id in (" . implode(',', array_column($promoter_ids, 'id')) . ") ";
$spendprom = " AND ss.promote_id IN (" . implode(',', array_column($promoter_ids, 'id')) . ") ";
}
}
}
$game_map = "";
if (isset($_REQUEST['game_name'])) {
$game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
}
$game_play_map = '';
if (isset($_REQUEST['server_name'])) {
$game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
}
// if (isset($_REQUEST['promote_account'])) {
// $map['promote_id'] = get_promote_id(trim(I('promote_account')));
// unset($_REQUEST['promote_account']);
// }
if (isset($_REQUEST['register_way'])) {
if($_REQUEST['type']==1) {
if (I('type', 1) == 1) {
if (isset($_GET['register_way'])) {
if ($_GET['register_way'] == 1) {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (0,1)';
$maps['tab_user.register_type'] = ['in',[0,1]];
} elseif($_GET['register_way'] == 7){
$hav .= ' tab_user.register_type in (1)';
$maps['tab_user.register_type'] = 1;
} elseif ($_GET['register_way'] == 7) {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in(7)';
$maps['tab_user.register_type'] = 7;
}else {
} else {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in(2)';
$maps['tab_user.register_type'] = 2;
}
} else {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (1,2,7)';
$maps['tab_user.register_type'] = ['in', [1, 2, 7]];
}
} else {
if (isset($_GET['register_type'])) {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type = ' . $_GET['register_type'];
$maps['tab_user.register_type'] = $_GET['register_type'];
$map['register_way'] = I('register_way');
unset($_REQUEST['register_way']);
} else {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (0,3,4,5,6)';
$maps['tab_user.register_type'] = ['in', [0, 3, 4, 5, 6]];
}
}
if (isset($_REQUEST['register_type'])) {
$map['register_type'] = I('register_type');
unset($_REQUEST['register_type']);
if (isset($_REQUEST['user_id'])) {
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.id = '{$_REQUEST['user_id']}'";
$maps['tab_user.id'] = $_REQUEST['user_id'];
unset($_REQUEST['user_id']);
}
if (isset($_REQUEST['account'])) {
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.account like '%" . I('account') . "%'";
$maps['tab_user.account'] = ['like', "%" . I('account') . "%"];
unset($_REQUEST['account']);
}
if (isset($_REQUEST['device_number'])) {
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.device_number = '{$_REQUEST['device_number']}'";
$maps['tab_user.device_number'] = $_REQUEST['device_number'];
unset($_REQUEST['device_number']);
}
if (isset($_REQUEST['age_status'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.age_status =' . I('age_status');
$maps['tab_user.age_status'] = I('age_status');
unset($_REQUEST['age_status']);
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time BETWEEN ' . strtotime(I('time_start')) . ' AND ' . (strtotime(I('time_end')) + 24 * 60 * 60 - 1);
$maps['tab_user.register_time'] = ['between', [strtotime(I('time_start')), strtotime(I('time_end')) + 86399]];
unset($_REQUEST['time_start']);
unset($_REQUEST['time_end']);
} elseif (isset($_REQUEST['time_start'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time > ' . strtotime(I('time_start'));
$maps['tab_user.register_time'] = ['GT', strtotime(I('time_start'))];
unset($_REQUEST['time_start']);
} elseif (isset($_REQUEST['time_end'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time < ' . (strtotime(I('time_end')) + 86399);
$maps['tab_user.register_time'] = ['LT', strtotime(I('time_end')) + 86399];
unset($_REQUEST['time_end']);
}
if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time BETWEEN ' . strtotime(I('start')) . ' AND ' . strtotime(I('end'));
$maps['tab_user.register_time'] = array('between', [strtotime(I('start')), strtotime(I('end'))]);
unset($_REQUEST['start']);
unset($_REQUEST['end']);
}
if (!empty(I('line_day'))) {
$day = strtotime(date('Y-m-d')) - intval(I('line_day')) * 86400;
empty($hav) || $hav .= ' AND ';
$hav .= $day . '> tab_user.login_time';
$maps['tab_user.login_time'] = ['lt', $day];
}
if (isset($_REQUEST['status'])) {
$map['lock_status'] = I('status');
unset($_REQUEST['status']);
}
if (!empty(I('time_start')) && !empty(I('time_end'))) {
$map['register_time'] = array('BETWEEN', array(strtotime(I('get.time_start')), strtotime(I('time_end')) + 24 * 60 * 60 - 1));
unset($_REQUEST['time_start']);
unset($_REQUEST['time_end']);
$game_map = "";
if (isset($_REQUEST['game_name'])) {
$game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
}
$game_play_map = '';
if (isset($_REQUEST['server_name'])) {
$game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
}
empty(I('account')) || $map['account'] = ['like', '%' . I('account') . '%'];
// if (isset($_REQUEST['promote_account'])) {
// $map['promote_id'] = get_promote_id(trim(I('promote_account')));
// unset($_REQUEST['promote_account']);
// }
// if (isset($_REQUEST['register_way'])) {
// if($_REQUEST['type']==1) {
// if ($_GET['register_way'] == 1) {
// empty($hav) || $hav .= ' AND ';
// $hav .= ' tab_user.register_type in (0,1)';
// $maps['tab_user.register_type'] = ['in',[0,1]];
// } elseif($_GET['register_way'] == 7){
// empty($hav) || $hav .= ' AND ';
// $hav .= ' tab_user.register_type in(7)';
// $maps['tab_user.register_type'] = 7;
// }else {
// empty($hav) || $hav .= ' AND ';
// $hav .= ' tab_user.register_type in(2)';
// $maps['tab_user.register_type'] = 2;
// }
// } else {
//
//
// $map['register_way'] = I('register_way');
// unset($_REQUEST['register_way']);
// }
// }
// if (isset($_REQUEST['register_type'])) {
// $map['register_type'] = I('register_type');
// unset($_REQUEST['register_type']);
// }
// if (isset($_REQUEST['status'])) {
// $map['lock_status'] = $_REQUEST['status'];
// unset($_REQUEST['status']);
// }
// $game_map = "";
//
// if (isset($_REQUEST['game_name'])) {
// $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
// }
// $game_play_map = '';
// if (isset($_REQUEST['server_name'])) {
// $game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
// }
// empty(I('account')) || $map['account'] = ['like', '%' . I('account') . '%'];
//排序
if (I('total_status') == 1) {
$order = 'cumulative asc';
@ -335,7 +433,7 @@ class ExportController extends Controller
$map['puid'] = array('eq',0);
$map['is_platform'] = 0;
// var_dump($map);die();
set_time_limit(0);
// $columns = [
// '序号ID', '姓名', '电话',
@ -354,29 +452,40 @@ class ExportController extends Controller
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$usermodel = M('user', 'tab_');
$userField = "tab_user.id,device_number,age_status,account,balance,gold_coin,alipay,tab_user.promote_id,register_type,tab_user.promote_account,register_time,lock_status,register_way,register_ip,login_time,check_status";
$sql1 = $usermodel->field("{$userField},IFNULL(sum(b.pay_amount),0) as deposit_total")
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->where($hav)
->where($map)
->group('tab_user.id')
// ->order($order)
->select(false);
$accessNum = '100000';//从数据库获取总量,假设是十万
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$accessNum = M('user', 'tab_')
->field('IFNULL(sum(ss.pay_amount),0) AS recharge_total,count(tab_user.id) as count')
$accessNum = $usermodel->table('(' . $sql1 . ') as a ')
->field('IFNULL(sum(ss.pay_amount),0) AS recharge_total,count(a.id) as count')
// ->field($field)
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->group('a.id')
->having($havs)
->select(false);
$sql = "select count(t.count) as count from ({$accessNum}) as t ";
$accessNum = M('user', 'tab_')->query($sql);
}else{
$accessNum = M('user', 'tab_')
$accessNum = $usermodel->table('(' . $sql1 . ') as a ')
// ->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->field('IFNULL(sum(ss.pay_amount),0) AS recharge_total,count(tab_user.id) as count')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->field('IFNULL(sum(ss.pay_amount),0) AS recharge_total,count(a.id) as count')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->group('a.id')
->having($havs)
->select(false);
@ -388,31 +497,31 @@ class ExportController extends Controller
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
$lastId = 0;
for($i = 1; $i <= $pages; $i++) {
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$xlsData = M('user', 'tab_')
$xlsData = $usermodel->table('(' . $sql1 . ') as a ')
// ->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->field($field)
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->limit(($i-1)*$perSize ,$perSize)
->group('tab_user.id')
->group('a.id')
->order($order)
->having($havs)
->select();
}else{
$xlsData = M('user', 'tab_')
$xlsData = $usermodel->table('(' . $sql1 . ') as a ')
// ->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->field($field)
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->limit(($i-1)*$perSize ,$perSize)
->group('tab_user.id')
->group('a.id')
->order($order)
->having($havs)
->select();

@ -132,7 +132,7 @@ class IndexChartSetController extends AdminController {
foreach($hoursnews as $h) {
$user_hours[$h['time']] = (integer)$h['news'];
}
$this->adddata["new_user_hours"] = serialize($user_hours);
$this->adddata["new_user_hours"] = json_encode($user_hours);
unset($user_hours);
//获取当日所有的注册用户
$userList = $this->UserModel->field('count(1) count')
@ -159,7 +159,7 @@ class IndexChartSetController extends AdminController {
foreach($hoursnews as $h) {
$user_hours[$h['time']] = (integer)$h['active'];
}
$this->adddata["active_user_hours"] = serialize($user_hours);
$this->adddata["active_user_hours"] = json_encode($user_hours);
unset($user_hours);
//获取活跃用户列表
$activeCount = $this->LoginModel->field('user_id')
@ -168,7 +168,7 @@ class IndexChartSetController extends AdminController {
->select();
$this->adddata["active_user_count"] = count($activeCount);
$this->adddata["active_user_list"] = serialize(array_column($activeCount,'user_id'));
$this->adddata["active_user_list"] =json_encode(array_map("intFun",array_column($activeCount,'user_id')));
unset($activeCount);
}
/**
@ -189,7 +189,7 @@ class IndexChartSetController extends AdminController {
foreach($hoursnews as $h) {
$user_hours[$h['time']] = (integer)$h['payuser'];
}
$this->adddata["pay_user_hours"] = serialize($user_hours);
$this->adddata["pay_user_hours"] = json_encode($user_hours);
unset($user_hours);
$activeCount = $this->SpendModel->field('user_id')
->where($map)
@ -197,7 +197,7 @@ class IndexChartSetController extends AdminController {
->select();
$this->adddata["pay_user_count"] = count($activeCount);
$this->adddata["pay_user_list"] = serialize(array_column($activeCount,'user_id'));
$this->adddata["pay_user_list"] = json_encode(array_map("intFun",array_column($activeCount,'user_id')));
unset($activeCount);
}
/**
@ -220,7 +220,7 @@ class IndexChartSetController extends AdminController {
foreach($hoursnews as $h) {
$user_hours[$h['time']] = (integer)$h['money'];
}
$this->adddata["pay_money_hours"] = serialize($user_hours);
$this->adddata["pay_money_hours"] = json_encode($user_hours);
unset($user_hours);
$activeCount = $this->SpendModel->field('sum(pay_amount) AS money')
@ -248,7 +248,7 @@ class IndexChartSetController extends AdminController {
foreach($hoursnews as $h) {
$user_hours[$h['time']] = (integer)$h['news'];
}
$this->adddata["promote_new_hours"] = serialize($user_hours);//promote_new_hours
$this->adddata["promote_new_hours"] = json_encode($user_hours);//promote_new_hours
unset($user_hours);
$activeCount = $this->PromoteModel->field('COUNT(1) AS news')
@ -274,7 +274,7 @@ class IndexChartSetController extends AdminController {
$allcount['player_count'] =$spend->player();
$allcount['money_sum'] =$spend->totalAmount();
$allcount['promote_sum'] =$promote->total();
$this->adddata["all_count"] = serialize($allcount);
$this->adddata["all_count"] = json_encode($allcount);
}
public function createDb()
{
@ -282,5 +282,5 @@ class IndexChartSetController extends AdminController {
$this->adddata['create_time']=$this->nowdata;
$this->ChartModel->add($this->adddata);
}
}

@ -50,7 +50,7 @@ class IndexController extends AdminController {
}
$tm =strtotime(date("Y-m-d",strtotime("-1 day")));
$allcount = M("IndexChart","tab_")->field("all_count")->where("`date` = '{$tm}'")->find();
$allcount = unserialize($allcount['all_count']);
$allcount = json_decode($allcount['all_count'],true);
$this->assign('user_count',$allcount['user_count']);
$this->assign('active_count', $allcount['active_count']);
@ -224,10 +224,10 @@ class IndexController extends AdminController {
$data['hours'] = 1;
$tm = strtotime($start);
$dbdata = M("IndexChart","tab_")->field("new_user_count,new_user_hours,active_user_count,active_user_hours,pay_user_count,pay_user_hours,pay_money_count,pay_money_hours,promote_new_count")->where("`date` = '{$tm}'")->find();
$data['news'] = unserialize($dbdata["new_user_hours"]);
$data['active'] = unserialize($dbdata["active_user_hours"]);
$data['player']=unserialize($dbdata["pay_user_hours"]);
$data['money']=unserialize($dbdata["pay_money_hours"]);
$data['news'] = json_decode($dbdata["new_user_hours"],true);
$data['active'] = json_decode($dbdata["active_user_hours"],true);
$data['player']=json_decode($dbdata["pay_user_hours"],true);
$data['money']=json_decode($dbdata["pay_money_hours"],true);
//获取昨天
$ytm = $starttime-86400;
@ -260,24 +260,42 @@ class IndexController extends AdminController {
$count1 = array();
$active_user_list = [];
$pay_user_list = [];
$dbdata = M("IndexChart","tab_")->field("new_user_count,active_user_count,active_user_list,pay_user_count,pay_user_list,pay_money_count,promote_new_count")
->where($map)->select();
$dbdata = M("IndexChart","tab_")->field("FROM_UNIXTIME(`date`, '%Y-%m-%d') as time,new_user_count,active_user_count,active_user_list,pay_user_count,pay_user_list,pay_money_count,promote_new_count")
->where($map)
->group("time")
->select();
//替换数据
$temparr = array();
for ($i=0; $i < count($datelist); $i++) {
$temparr[$datelist[$i]]['news'] = 0;
$temparr[$datelist[$i]]['active'] = 0;
$temparr[$datelist[$i]]['player'] = 0;
$temparr[$datelist[$i]]['money'] = 0;
}
foreach($dbdata as $k => $v) {
$data['news'][$k] = $v['new_user_count'];
$data['active'][$k] = $v['active_user_count'];
$data['player'][$k] = $v['pay_user_count'];
$data['money'][$k] = $v['pay_money_count'];
$active_user_list += unserialize($v['active_user_list']);
$temparr[$v['time']]['news'] =$v['new_user_count'];
$temparr[$v['time']]['active'] =$v['active_user_count'];
$temparr[$v['time']]['player'] =$v['pay_user_count'];
$temparr[$v['time']]['money'] =$v['pay_money_count'];
$active_user_list += json_decode($v['active_user_list'],true);
unset($v['active_user_list']);
unset($dbdata[$k]['active_user_list']);
$pay_user_list += unserialize($v['pay_user_list']);
$pay_user_list += json_decode($v['pay_user_list'],true);
unset($v['pay_user_list']);
unset($dbdata[$k]['pay_user_list']);
$count1['new_user_count'] += $v['new_user_count'];
$count1['pay_money_count'] += $v['pay_money_count'];
$count1['promote_new_count'] += $v['promote_new_count'];
}
foreach ($temparr as $key => $value) {
# code...
$data['news'][] = $value['news'];
$data['active'][] = $value['active'];
$data['player'][] = $value['player'];
$data['money'][] = $value['money'];
}
unset($dbdata);
$count1['active_user_count'] = count(array_flip(array_flip($active_user_list)));
unset($active_user_list);
@ -318,10 +336,10 @@ class IndexController extends AdminController {
$pay_user_list = [];
$count2 = array();
foreach($ydbdata as $k => $v) {
$active_user_list += unserialize($v['active_user_list']);
$active_user_list += json_decode($v['active_user_list'],true);
unset($v['active_user_list']);
unset($ydbdata[$k]['active_user_list']);
$pay_user_list += unserialize($v['pay_user_list']);
$pay_user_list += json_decode($v['pay_user_list'],true);
unset($v['pay_user_list']);
unset($ydbdata[$k]['pay_user_list']);
$count2['new_user_count'] += $v['new_user_count'];

@ -169,14 +169,16 @@ class MemberController extends ThinkController
$map['is_platform'] = 0;
//数据
$usermodel = M('user', 'tab_');
$sql1 = $usermodel->field('tab_user.*,IFNULL(sum(b.pay_amount),0) as deposit_total')
$userField = "tab_user.id,device_number,age_status,account,balance,gold_coin,alipay,tab_user.promote_id,register_type,tab_user.promote_account,register_time,lock_status,register_way,register_ip,login_time,check_status";
$sql1 = $usermodel->field("{$userField},IFNULL(sum(b.pay_amount),0) as deposit_total")
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->where($map)
->group('tab_user.id')
->where($hav)
// ->order($order)
->select(false);
// $data = $usermodel->table('(' . $sql1 . ') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,IFNULL(sum(ss.pay_amount),0) as recharge_total,check_status')
// ->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
// ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
@ -209,7 +211,6 @@ class MemberController extends ThinkController
->select();
}
//计数
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')

File diff suppressed because it is too large Load Diff

@ -74,7 +74,7 @@ class RechargeSumController extends ThinkController
case 'GUANFANG':
$data[$key]['promote_id'] = "官方渠道";
break;
case 0:
case '0':
$data[$key]['promote_id'] = "官方渠道";
break;
case 'PROMOTE':
@ -87,6 +87,7 @@ class RechargeSumController extends ThinkController
$data[$key]['promote_id'] = empty($_REQUEST['promote_id']) ? "全部" : get_promote_account($_REQUEST['promote_id']);
break;
}
$data[$key]['registerNum'] = count($registerNum);
$data[$key]['livenNum'] = $livenNum;
$data[$key]['newAddPay'] = empty($newAddPay) ? 0 : $newAddPay;

@ -125,7 +125,7 @@ class ToolController extends ThinkController {
*/
public function smsset($value='')
{
$this->BaseConfig("sms_set,alidayu,jiguang,alidayunew");
$this->BaseConfig("sms_set,alidayu,jiguang,alidayunew,zhongwang");
$this->meta_title = '短信设置';
$this->m_title = '短信设置';

@ -197,7 +197,7 @@
<tbody>
<if condition = "empty($list_data)">
<tr>
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "list_data">

@ -151,7 +151,9 @@
<th>游戏名称</th>
<th>所属推广员</th>
<th>充值ip</th>
<th>区服ID</th>
<th>游戏区服</th>
<th>角色ID</th>
<th>角色名称</th>
<th>订单金额</th>
<th><a class="paixu" data-order='pay_amount'>
@ -180,12 +182,16 @@
<td>{$data.spend_ip}</td>
<empty name='data.server_name'>
<td>— —</td>
<td>— —</td>
<else/>
<td>{$data.server_id}</td>
<td>{$data.server_name}</td>
</empty>
<empty name='data.game_player_name'>
<td>— —</td>
<td>— —</td>
<else/>
<td>{$data.game_player_id}</td>
<td>{$data.game_player_name}</td>
</empty>
<td>{$data.cost|default=0.00}</td>

@ -9,6 +9,7 @@
<li data-tab="tab2"><a href="javascript:void(0);" >阿里大鱼(老)</a></li>
<li data-tab="tab3"><a href="javascript:void(0);" >极光</a></li>
<li data-tab="tab4"><a href="javascript:void(0);" >阿里大鱼(新)</a></li>
<li data-tab="tab5"><a href="javascript:void(0);" >中网</a></li>
</ul>
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">用于配置短信通知功能相关参数的功能</p>
@ -297,17 +298,66 @@
</div>
</div>
</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="{$m_url}">
</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>
<div class="tab-content tabcon1711 tabcon17112">
<div id="tab5" class="tab-pane tab5">
<form action="{:U('saveTool')}" method="post" class="form-horizontal zhongwang form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">账号</td>
<td class="r table_radio">
<input name="config[smtp_account]" type="text" value="{$zhongwang['smtp_account']}" class="">
<span class="notice-text">账号</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">密码</td>
<td class="r table_radio">
<input name="config[smtp_password]" type="text" value="{$zhongwang['smtp_password']}" class="">
<span class="notice-text">密码</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">每日IP发送数量</td>
<td class="r table_radio">
<input name="config[limit]" type="text" value="{$zhongwang['limit']}" class="">
<span class="notice-text">0或空则不限制</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">启用状态</td>
<td class="r table_radio">
<span class="form_radio">
<label>
<input type="radio" name="status" value="0" <eq name="zhongwang_data['status']" value="0">checked="checked"</eq>> 禁用
</label>
<label>
<input type="radio" name="status" value="1" <eq name="zhongwang_data['status']" value="1">checked="checked"</eq>> 启用
</label>
</span>
<span class="notice-text">短信设置启用状态</span>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="name" value="zhongwang">
<input type="submit" value="保存" target-form="zhongwang" class="submit_btn form_btn ajax-post mlspacing">
</form>
</div>
</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="{$m_url}">
</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">

@ -1995,18 +1995,34 @@ function get_parent_promote_($prmote_id=0,$isShwo=true)
//获取当前子渠道
function get_zi_promote_id($id){
$map['parent_id']=$id;
$map['grand_id'] = $id;
$map['_logic'] = 'or';
$pro=M("promote","tab_")->field('id')->where($map)->select();
if(null==$pro){
return 0;
}else{
for ($i=0; $i <count($pro); $i++) {
$sd[]=implode(",", $pro[$i]);
}
return implode(",", $sd);
// $map['parent_id']=$id;
// $map['grand_id'] = $id;
// $map['_logic'] = 'or';
// $pro=M("promote","tab_")->field('id')->where($map)->select();
// if(null==$pro){
// return 0;
// }else{
// for ($i=0; $i <count($pro); $i++) {
// $sd[]=implode(",", $pro[$i]);
// }
// return implode(",", $sd);
// }
$promote = M("promote","tab_");
//获取自己的等级
$self = $promote->field("chain,level")->where("id = '{$id}'")->find();
if ($self['level'] == 1) {
$self['chain'] = "/{$id}/";
}
$map['status'] = 1;
$map["chain"] = array("LIKE","%{$self['chain']}%");
$map["level"] = array("GT",$self['level']);
$data = $promote->field("id")->where($map)->select();
if(empty($data)){return array();}
$data = implode(",",array_column($data,"id"));
return $data;
}
/**

@ -481,17 +481,7 @@ class DownloadController extends BaseController {
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($rs)) {
$map['tab_test_resource.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds];
}
$map['tab_test_resource.promote_id'] = PID;
if(!empty(I('role_name'))){
$map['role_name']=['like','%'.I('role_name').'%'];
@ -547,17 +537,7 @@ class DownloadController extends BaseController {
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($rs)) {
$map['tab_test_resource.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds];
}
$map['tab_test_resource.promote_id'] = PID;
if(!empty(I('type'))||I('type')==='0'){
$map['apply_status']=I('type');
@ -617,33 +597,23 @@ class DownloadController extends BaseController {
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($rs)) {
$map['tab_test_resource.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds];
}
$map['tab_test_resource.promote_id'] = PID;
if(!empty(I('server_name'))){
$map['tab_test_resource.server_name']=I('server_name');
}
if(!empty(I('game_name'))){
$map['tab_test_resource.game_name']=I('game_name');
}
if(!empty(I('role_name'))){
$map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
}
if(!empty(I('user_account'))){
$map['tab_test_resource.user_account']=['like','%'.I('user_account').'%'];
}
if(!empty(I('promote_id'))){
$map['tab_test_resource.promote_id']=I('promote_id');
}
if(!empty(I('server_name'))){
$map['tab_test_resource.server_name']=I('server_name');
}
if(!empty(I('game_name'))){
$map['tab_test_resource.game_name']=I('game_name');
}
if(!empty(I('role_name'))){
$map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
}
if(!empty(I('user_account'))){
$map['tab_test_resource.user_account']=['like','%'.I('user_account').'%'];
}
if(!empty(I('promote_id'))){
$map['tab_test_resource.promote_id']=I('promote_id');
}
$conditions = json_encode($map,TRUE);
$addtime = time();
@ -831,6 +801,9 @@ class DownloadController extends BaseController {
* @author sunke
*/
public function regist_data_export() {
if (empty(I('begtime')) || empty(I('endtime'))) {
$this->error('请选择起止时间');
}
$beginTime = strtotime(I('begtime') . ' 00:00:00');
$endtime = strtotime(I('endtime') . ' 23:59:59');
if (($endtime - $beginTime) > 31 * 24 * 3600) {
@ -852,7 +825,7 @@ class DownloadController extends BaseController {
}
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],

@ -663,7 +663,7 @@
$('.add-game').on('click', function () {
var thisElement = $(this);
var gameId = thisElement.attr('game-id');
var promoteType = thisElement.attr('promote-type');
var promoteType = parseInt(thisElement.attr('promote-type'));
$.ajax({
type: "post",
@ -690,8 +690,16 @@
});
}
if (promoteType == 3) {
$('#add_promote_title').text('添加推广员:');
switch (promoteType) {
case 2:
$('#add_promote_title').text('添加部长:');
break;
case 3:
$('#add_promote_title').text('添加组长:');
break;
case 4:
$('#add_promote_title').text('添加推广员:');
break;
}
$.myMethod("#add_promote_data",tagData,"add_promote_ids");

Loading…
Cancel
Save