Merge branch 'release-1.0.0' of 47.111.118.107:wmtx/platform into release-1.0.0

master
zhanglingsheng 5 years ago
commit 908de1336f

@ -1770,4 +1770,27 @@ function data2csv(&$data,$title,$fields){
fclose($fp); //每生成一个文件关闭
die();
}
//所有支付方式
function all_pay_way_other($type=false)
{
if($type){
$pay_way[0]=array('key'=>0,'value'=>"平台币");
}
$pay_way[1]=array('key'=>-1,'value'=>"绑币");
$pay_way[2]=array('key'=>1,'value'=>"支付宝");
$pay_way[3]=array('key'=>2,'value'=>"微信");
$pay_way[7]=array('key'=>7,'value'=>'金猪');
$pay_way[9]=array('key'=>9,'value'=>"双乾支付-支付宝");
$pay_way[10]=array('key'=>10,'value'=>"双乾支付-银联");
// $pay_way[3]=array('key'=>3,'value'=>'微信APP');
// $pay_way[4]=array('key'=>4,'value'=>'威富通');
/* $pay_way[4]=array('key'=>5,'value'=>'聚宝云'); */
// $pay_way[5]=array('key'=>6,'value'=>'汇付宝');
/* $pay_way[6]=array('key'=>7,'value'=>"苹果支付");
*/
$pay_way[15]=array('key'=>15,'value'=>'双乾支付-快捷');
return $pay_way;
}
?>

@ -83,7 +83,7 @@ class AjaxController extends ThinkController{
if ($sdk_version) {
$map['server_version'] = $game_map['sdk_version'] = $sdk_version;
}else {
$this->AjaxReturn([]);
// $this->AjaxReturn([]);
}
$game = M("Game", 'tab_')->where($game_map)->getField('id', true);

@ -7,6 +7,7 @@ use Admin\Model\SpendModel;
use Think\Think;
use Base\Tool\Printer;
use Base\Service\PromoteService;
use GuzzleHttp\Client;
class ConsoleController extends Think {
@ -263,4 +264,43 @@ class ConsoleController extends Think {
}
}
}
public function testLogin()
{
/* $client = new Client([
'base_uri' => 'http://47.111.118.107:9501',
'timeout' => 10.0,
]);
$response = $client->post('/game-event/login', [
'form_params' => [
'user_id' => 28747,
'game_id' => 153,
'login_time' => 1577361998
]
]);
$result = (string)$response->getBody();
echo $result; */
$data = [
'user_id' => 28747,
'game_id' => 153,
'login_time' => 1577361998
];
$client = new Client([
'base_uri' => 'http://47.111.118.107:9501',
'timeout' => 5.0,
]);
$promise = $client->requestAsync('POST', '/game-event/login', [
'form_params' => $data
]);
$promise->then(
function (ResponseInterface $res) {
echo $res->getStatusCode() . PHP_EOL;
},
function (RequestException $e) {
echo $e->getMessage() . PHP_EOL;
echo $e->getRequest()->getMethod();
}
);
}
}

@ -3512,23 +3512,24 @@ class ExportController extends Controller
$start_time = $start = strtotime($start);
$end_time = $end = strtotime($end) + 86400;
if (is_file(RUNTIME_PATH.'/access_data_ltv.txt')) {
$filetxt = file_get_contents(RUNTIME_PATH.'/access_data_ltv.txt');
// if (is_file(RUNTIME_PATH.'/access_data_ltv.txt')) {
// $filetxt = file_get_contents(RUNTIME_PATH.'/access_data_ltv.txt');
$data = json_decode($filetxt, true);
}
// $data = json_decode($filetxt, true);
// }
$map = " 1=1 ";
$game_map = "";
if (isset($_REQUEST['game_name'])) {
if (isset($_REQUEST['game_name']) && isset($_REQUEST['server_name'])) {
$game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id'));
$map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
$map .= " AND game_id in ({$game_ids})";
$game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play_info as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id ";
if (isset($_REQUEST['server_name'])) $game_map .= " AND upi.server_name = '{$_REQUEST['server_name']}' ";
$game_map .= ") ";
}
if (isset($_REQUEST['server_name'])) {
$map .= " AND server_name = '{$_REQUEST['server_name']}' ";
} else if (isset($_REQUEST['game_name'])) {
$game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id'));
$map .= " AND game_id in ({$game_ids})";
$game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id ";
$game_map .= ") ";
}
// 获取包含的用户id
@ -7208,7 +7209,7 @@ class ExportController extends Controller
$map['_string'] .= " pay_time < {$timeend}";
}
$map['pay_status'] = 1;
$map['pay_game_status'] = 1;
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
}
@ -7224,6 +7225,7 @@ class ExportController extends Controller
$order = "pay_time DESC";
$xlsData = D('spend')->getSpendData($map,$field,$group,$order);
// dd(D("spend")->_sql());
foreach($xlsData as $key => $value) {
$xlsData[$key]['pay_way'] = getPayType($value['pay_way']);
}

@ -1079,7 +1079,7 @@ class FinanceController extends ThinkController
//推广后台
$spreadData = M("coin_pay_order","tab_")
->field("pay_way,'' as pay_type,sum(real_amount) as pay_amount")
->field("pay_way,'' as pay_type,sum(pay_amount) as pay_amount")
->where([
'order_status'=>['egt',1],
'pay_way'=>['egt',1],'pay_time'=>$time

@ -56,19 +56,19 @@ class FinancePromoteController extends AdminController
$senddata[$v['p_id']] = $v;
};
}
if(array_key_exists(0,$senddata) || $_REQUEST['promote_id']==0){
$pmap['status']=1;
if($istimeselect){
$pmap['create_time'] = $istimeselect;
}
$admininside = M("provide_user p","tab_")->field("sum(amount) amount")->where($pmap)->find();
if($admininside['amount'] >0){
$senddata[0]['inside_cash_count']= $admininside['amount'];
if(!empty($senddata)){
if(array_key_exists(0,$senddata) || $_REQUEST['promote_id']==0){
$pmap['status']=1;
if($istimeselect){
$pmap['create_time'] = $istimeselect;
}
$admininside = M("provide_user p","tab_")->field("sum(amount) amount")->where($pmap)->find();
if($admininside['amount'] >0){
$senddata[0]['inside_cash_count']= $admininside['amount'];
}
}
}
$data = [];
$count =array(
"cash_count"=>0,
@ -132,6 +132,9 @@ class FinancePromoteController extends AdminController
}
}
}
if (isset($_REQUEST['company_id'])) {
$map['promote.company_id'] = $_REQUEST['company_id'];
}
if($type == "spend"){
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
@ -289,6 +292,9 @@ class FinancePromoteController extends AdminController
}
}
}
if (isset($_REQUEST['company_id'])) {
$map['promote.company_id'] = $_REQUEST['company_id'];
}
if ($type == "spend") {
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );

@ -284,7 +284,7 @@ class PayChannelController extends ThinkController
}
}
$payTypeDataExport['pay_amount'] .= "平台币直充总金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)".
($coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost);
($coinSum);
$channelDataExport['game_name'] = '支付渠道';
foreach($channelData as $key => $value) {

@ -56,7 +56,6 @@ class PlatformController extends ThinkController
->group('fgame_id')
->order('count desc,register_time')
->select();
// dd($data);
$map2 = array();
$map2['fgame_id'] = array('egt', 0);
$map2['puid'] = 0;
@ -69,7 +68,6 @@ class PlatformController extends ThinkController
->group('fgame_id')
->select();
$data2 = array_column($data2, null, 'fgame_id');
// dd($data2);
$count = count($data);
foreach ($data as $key => $value) {
static $i = 0;
@ -139,12 +137,12 @@ class PlatformController extends ThinkController
//为数据权限添加
setPowerPromoteIds($map);
$map['game_id'] = array('gt', 0);
// var_dump($_REQUEST);exit;
if (isset($_REQUEST['game_name']) && $_REQUEST['game_name'] != '') {
$map['game_id'] = $_REQUEST['game_name'];
unset($_REQUEST['game_name']);
}
$map['game_id'] = array('gt', 0);
$map['pay_status'] = 1;
$today = total(1);
$week = total(2);
@ -504,6 +502,12 @@ class PlatformController extends ThinkController
$tmdata[$v['id']]['today'] = $v['today'];
$tmdata[$v['id']]['week'] = $v['week'];
$tmdata[$v['id']]['mounth'] = $v['mounth'];
if (!$tmdata[$v['id']]['promote_account']) {
$tmdata[$v['id']]['promote_account'] = $v['promote_account'];
$tmdata[$v['id']]['count'] = 0;
}
}
$data = [];
@ -612,19 +616,6 @@ class PlatformController extends ThinkController
$week = total(2);
$mounth = total(3);
unset( $map['create_time']);
//获取所有会长
$promote_map = "`chain` = '/'";
if (isset($_REQUEST['promote_id'])) {
$promote_map = "`chain` = '%/{$_REQUEST['promote_id']}/%' OR id = {$_REQUEST['promote_id']}";
}
//为数据权限添加
setPowerPromoteIds($map);
$promote_map2 = array();
setPowerPromoteIds($promote_map2, 'id');
$promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->where($promote_map2)->select();
$pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->where($promote_map2)->find()['acount'];
// var_dump( $promote);
$tweek = total(2,false);
$tmonth = total(3,false);
@ -635,50 +626,71 @@ class PlatformController extends ThinkController
}else{
$tmin = $tmonth[1][0];
}
//为数据权限添加
setPowerPromoteIds($map, 'tp1.id');
if (isset($_REQUEST['promote_id'])) {
$map['tp1.id'] = $_REQUEST['promote_id'];
} else {
$map['tp1.chain'] = '/';
}
$data =array();
for ($i=0; $i < count($promote); $i++) {
# code...
$proid = M("promote","tab_")->field("id")->where("`chain` like '%/{$promote[$i]['id']}/%'")->select();
$str = '';
for($k=0; $k<count($proid); $k++){
# code...
$str .= ($proid[$k]['id'].",");
if (isset($_REQUEST['game_name'])) {
$map['s.game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['s.server_id'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
$str .= "{$promote[$i]['id']}";
$map['promote_id'] = array("in",$str);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['server_name'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
}
$dbdata = $spend
->field('floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count')
->where($map)
->find();
$tmap = $map;
if(isset($map['pay_time'])){
$tmap['pay_time'] = ['between', array($tmin,$tmonth[1][1])];
}
$data = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id,
floor(sum(pay_amount)*100) as count')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_spend as s on tp2.id = s.promote_id", 'left')
->where($map)
->group('tp1.id')
->order('count desc')
->select();
//今日/本周/本月不变
$tmap = $map;
if(isset($map['pay_time'])){
$tmap['pay_time'] = ['between', array($tmin,$tmonth[1][1])];
}
$tdata = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id,
floor(sum(IF(s.pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(s.pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(s.pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_spend as s on tp2.id = s.promote_id", 'left')
->where($tmap)
->group('tp1.id')
->select();
$tmdata = [];
foreach($data as $k=>$v){
$v['today'] = 0;
$v['week'] = 0;
$v['mounth'] = 0;
$tmdata[$v['id']] = $v;
}
foreach ($tdata as $k => $v) {
$tmdata[$v['id']]['today'] = $v['today'];
$tmdata[$v['id']]['week'] = $v['week'];
$tmdata[$v['id']]['mounth'] = $v['mounth'];
if (!$tmdata[$v['id']]['promote_account']) {
$tmdata[$v['id']]['promote_account'] = $v['promote_account'];
$tmdata[$v['id']]['count'] = 0;
}
$tdbdata = $spend
->field('
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($tmap)
->find();
$dbdata['today']= $tdbdata['today'];
$dbdata['week']= $tdbdata['week'];
$dbdata['mounth']= $tdbdata['mounth'];
$dbdata['promote_account'] = $promote[$i]['account'];
$dbdata['promote_id'] = $promote[$i]['id'];
$data[] = $dbdata;
}
$data = [];
foreach($tmdata as $k => $v){
$data[] = $v;
}
// dd($data);
$count = count($data);
foreach ($data as $key => $value) {
$value['count'] ?: 0;
@ -703,7 +715,7 @@ class PlatformController extends ThinkController
$this->assign('userarpu_order_type', $data_order_type);
}
$page = set_pagination($pcount, $row);
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
@ -712,13 +724,24 @@ class PlatformController extends ThinkController
$size = $row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
if(isset($_REQUEST['export'])){
data2csv($data,'推广员充值统计',array(
"promote_account"=>"推广员账号",
"count"=>"累计充值",
"rand"=>"排行榜",
"today"=>"今日充值",
"week"=>"本周充值",
"mounth"=>"本月充值",
));
}
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->meta_title = '渠道充值统计列表';
$this->assign('list_data', $data);
$this->assign("is_admin",is_administrator());
$this->display();
}
function promotepay_statistics_1($p = 0)
public function promotepay_statistics1($p = 0)
{
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
@ -731,84 +754,97 @@ class PlatformController extends ThinkController
$map1['promote_id'] = $map['promote_id'] = array('egt', 0);
$spend = M('Spend', 'tab_');
if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$map['create_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
$pay_time = " between " . strtotime($_REQUEST['timestart']) . " and " . (strtotime($_REQUEST['timeend']) + 86399) . " ";
$map['pay_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
} elseif (!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) {
$map['create_time'] = ['between', array(strtotime($_REQUEST['timestart']), time())];
$pay_time = " between " . strtotime($_REQUEST['timestart']) . " and " . time() . " ";
$map['pay_time'] = ['between', array(strtotime($_REQUEST['timestart']), time())];
unset($_REQUEST['timestart']);
} elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$map['create_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
$pay_time = " between 0 and " . (strtotime($_REQUEST['timeend']) + 86399) . " ";
$map['pay_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
unset($_REQUEST['timeend']);
} else {
$pay_time = " between 0 and " . time();
$map['pay_time'] = ['between', array(0, time())];
// $pay_time = " between 0 and " . time();
}
$map1['pay_status'] = $map['pay_status'] = 1;
$today = total(1);
$week = total(2);
$mounth = total(3);
// $map1['pay_way'] = $map['pay_way'] = array('gt', 0);
$bindrecharge_data = M('bind_recharge', 'tab_')
->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time,
floor(sum(IF(create_time ' . $pay_time . ',real_amount,0))*100) as scount,
floor(sum(IF(create_time ' . $today . ',real_amount,0))*100) as today,
floor(sum(IF(create_time ' . $week . ',real_amount,0))*100) as week,
floor(sum(IF(create_time ' . $mounth . ',real_amount,0))*100) as mounth')
->where($map1)
->group('promote_id')
->select(false);
$deposit_data = M('deposit', 'tab_')
->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time,
floor(sum(IF(create_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(create_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(create_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(create_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map1)
->group('promote_id')
->select(false);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['server_name'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
unset( $map['create_time']);
//获取所有会长
$promote_map = "`chain` = '/'";
if (isset($_REQUEST['promote_id'])) {
$promote_map = "`chain` = '%/{$_REQUEST['promote_id']}/%' OR id = {$_REQUEST['promote_id']}";
}
//为数据权限添加
setPowerPromoteIds($map);
$promote_map2 = array();
setPowerPromoteIds($promote_map2, 'id');
$promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->where($promote_map2)->select();
$pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->where($promote_map2)->find()['acount'];
// var_dump( $promote);
$tweek = total(2,false);
$tmonth = total(3,false);
//获取最小
$tmin = 0;
if($tweek[1][0] < $tmonth[1][0]){
$tmin = $tweek[1][0];
}else{
$tmin = $tmonth[1][0];
}
$data =array();
for ($i=0; $i < count($promote); $i++) {
# code...
$proid = M("promote","tab_")->field("id")->where("`chain` like '%/{$promote[$i]['id']}/%'")->select();
$str = '';
for($k=0; $k<count($proid); $k++){
# code...
$str .= ($proid[$k]['id'].",");
}
$data = $spend
->field('max(id) as id,promote_account,promote_id,pay_time as ordertime,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time,
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map)
->group('promote_id')
->select(false);
} else {
$data = $spend
->field('max(id) as id,promote_account,promote_id,pay_time as ordertime,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time,
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
$str .= "{$promote[$i]['id']}";
$map['promote_id'] = array("in",$str);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['server_name'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
}
$dbdata = $spend
->field('floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count')
->where($map)
// ->union(' (' . $bindrecharge_data . ') ')
// ->union(' (' . $deposit_data . ') ')
->group('promote_id')
->select(false);
}
$promote_map = "tp1.`chain` = '/'";
if (isset($_REQUEST['promote_id'])) {
$promote_map = "tp1.`id` = {$_REQUEST['promote_id']}";
unset($_REQUEST['promote_id']);
->find();
$tmap = $map;
if(isset($map['pay_time'])){
$tmap['pay_time'] = ['between', array($tmin,$tmonth[1][1])];
}
$tdbdata = $spend
->field('
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($tmap)
->find();
$dbdata['today']= $tdbdata['today'];
$dbdata['week']= $tdbdata['week'];
$dbdata['mounth']= $tdbdata['mounth'];
$dbdata['promote_account'] = $promote[$i]['account'];
$dbdata['promote_id'] = $promote[$i]['id'];
$data[] = $dbdata;
}
$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 or promote_id = t.pid")
->where($condition)->table('(' . $data . ') as a')->group('t.pid')->order('count desc,a.ordertime')->select();
$count = count($data);
foreach ($data as $key => $value) {
$value['count'] ?: 0;
$value['today'] ?: 0;
$value['week'] ?: 0;
$value['mounth'] ?: 0;
static $i = 0;
$i++;
$data[$key]['rand'] = $i;
@ -816,14 +852,8 @@ class PlatformController extends ThinkController
$data[$key]['today'] = $value['today'] / 100;
$data[$key]['week'] = $value['week'] / 100;
$data[$key]['mounth'] = $value['mounth'] / 100;
/* $adata=$this->day_data('Spend',array('promote_id'=>$value['promote_id']));
$data[$key]['today']=$adata['today']==''?0:$adata['today'];
$data[$key]['week']=$adata['week']==''?0:$adata['week'];
$data[$key]['mounth']=$adata['mounth']==''?0:$adata['mounth']; */
// if ($data[$key]['promote_id'] == '0') {
// unset($data[$key]);
// }
}
}
$total = $this->data_total($data);
$this->assign('total', $total);
if ($_REQUEST['data_order'] != '') {
@ -833,19 +863,20 @@ class PlatformController extends ThinkController
$this->assign('userarpu_order_type', $data_order_type);
}
$page = set_pagination($count, $row);
$page = set_pagination($pcount, $row);
if ($page) {
$this->assign('_page', $page);
}
$data = my_sort($data, $data_order_type, (int)$data_order);
$size = $row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
//用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度)
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->meta_title = '渠道充值统计列表';
$this->assign('list_data', $data);
$this->assign("is_admin",is_administrator());
$this->display();
}
public function data_total($data)
@ -971,6 +1002,21 @@ class PlatformController extends ThinkController
$this->display();
}
public function getSpendServer(){
if(isset($_REQUEST['game_name'])){
$game = M('Game','tab_')->field('id')->where(['game_name'=>$_REQUEST['game_name']])->find();
$game_id = $game['id'];
}
if(isset($_REQUEST['game_id'])){
$game_id = $_REQUEST['game_id'];
}
$map['game_id'] = $game_id;
$map['server_name'] = array('neq','');
$data = M('server','tab_')->field('server_name,server_id')->where($map)->group('server_name')->select();
$this->AjaxReturn($data);
}
public function uc_deposit($p = 1)
{
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {

@ -284,6 +284,9 @@ class PromoteController extends ThinkController
if ($this->accountExist($data['account'], $_POST['id'])) {
$this->error('该账号已存在');
}
if (empty(I('company_id'))) {
$this->error('请选择推广公司');
}
$pdata = D('Promote')->where($map1)->find();
if ($pdata) {

@ -262,13 +262,9 @@ class ServerNoticeController extends ThinkController {
$game_map = [];
if ($game_name) {
$game_map['relation_game_name'] = $game_name;
}else {
$this->AjaxReturn([]);
}
if ($sdk_version) {
$map['server_version'] = $game_map['sdk_version'] = $sdk_version;
}else {
$this->AjaxReturn([]);
}
$game = M("Game", 'tab_')->where($game_map)->getField('id', true);

@ -1035,15 +1035,17 @@ class StatisticsController extends ThinkController {
$map = " 1=1 ";
$game_map = "";
if (isset($_REQUEST['game_name'])) {
if (isset($_REQUEST['game_name']) && isset($_REQUEST['server_name'])) {
$game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id'));
$map .= " AND game_id in ({$game_ids})";
$game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play_info as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id ";
if (isset($_REQUEST['server_name'])) $game_map .= " AND upi.server_name = '{$_REQUEST['server_name']}' ";
$game_map .= ") ";
}
if (isset($_REQUEST['server_name'])) {
$map .= " AND server_name = '{$_REQUEST['server_name']}' ";
} else if (isset($_REQUEST['game_name'])) {
$game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id'));
$map .= " AND game_id in ({$game_ids})";
$game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id ";
$game_map .= ") ";
}
// 获取包含的用户id
$users = M()->query("

@ -239,8 +239,8 @@
<td>{$all_count['all_count']}</td>
<td style="text-align: center;">
<a
href="{:U('FinancePromote/gameStatistics',array_merge(I('get.'),['promote_type'=>1]))}">游戏查看</a>
<a href="{:U('FinancePromote/promoteUser',I('get.'))}">渠道查看</a>
href="{:U('FinancePromote/gameStatistics',array_merge(I('get.'),['promote_type'=>1,'p'=>1]))}">游戏查看</a>
<a href="{:U('FinancePromote/promoteUser',array_merge(I('get.'),['p'=>1]))}">渠道查看</a>
</td>
</tr>
</tbody>

@ -71,7 +71,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">支付渠道统计</h3>
<p class="description_text"></p>
<p class="description_text">说明平台币直充金额2019.12.18以前sdk新包数据及sdk旧包数据无法对应相关游戏无法计入以上平台币列表中<span style="color:red">充值方式统计</span>一栏统计<span style="color:red">平台币直充总金额</span></p>
<div class="fr">
<a class="tabchose" href="">游戏充值统计</a>
<a class="" href="{:U('Finance/payTypeStatistics')}">充值方式统计</a>

@ -88,21 +88,51 @@
<table>
<!-- 表头 -->
<thead>
<tr>
<!-- <th class="row-selected row-selected">
<input class="check-all" type="checkbox">
</th> -->
<!-- <tr>
<th >推广员账号</th>
<th ><a class="paixu" date-url='lzhuce'>累计充值</a></th>
<!-- <th ><a class="paixu" date-url='phb'>排行榜</a></th> -->
<th ><a class="paixu" date-url='phb'>排行榜</a></th>
<th ><a class="paixu" date-url='dzhuce'>今日充值</a></th>
<th ><a class="paixu" date-url='wzhuce'>本周充值</a></th>
<th ><a class="paixu" date-url='mzhuce'>本月充值</a></th>
</tr> -->
<tr>
<th >推广员账号</th>
<th ><a class="paixu" data-order='count'><if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'count'">累计充值▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'count'"/>累计充值▼
<else />累计充值<img src="__IMG__/up-down.png" width="13px">
</if></a></th>
<th ><a class="paixu" data-order='rand'><if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'rand'">排行榜▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'rand'"/>排行榜▼
<else />排行榜<img src="__IMG__/up-down.png" width="13px">
</if></a></th>
<th ><a class="paixu" data-order='today'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'today'">今日充值▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'today'"/>今日充值▼
<else />今日充值<img src="__IMG__/up-down.png" width="13px"></if>
</a></th>
<th ><a class="paixu" data-order='week'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'week'">本周充值▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'week'"/>本周充值▼
<else />本周充值<img src="__IMG__/up-down.png" width="13px">
</if>
</a></th>
<th ><a class="paixu" data-order='mounth'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'mounth'">本月充值▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'mounth'"/>本月充值▼
<else />本月充值<img src="__IMG__/up-down.png" width="13px"></if>
</a></th>
</tr>
</thead>
<!-- 列表 -->
@ -121,7 +151,7 @@
<tr>
<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 ><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>
@ -131,7 +161,7 @@
<tr class="data_summary">
<td><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<!-- <td>---</td> -->
<td>---</td>
<td>{$total.sum_today}</td>
<td>{$total.sum_week}</td>
<td>{$total.sum_mounth}</td>
@ -142,9 +172,8 @@
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/promote_statistics',
array('timestart'=>$_GET['timestart'],'timeend'=>$_GET['timeend'],'type'=>1,'promote_id'=>$_GET['promote_id'],p=>$_GET['p'],'xlsname'=>'统计_推广员统计_推广员充值统计',)
,false)}">导出</a>
<a class="sch-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
@ -209,69 +238,85 @@
// });
// });
$(".paixu").click(function(){
$ddd=$(this).attr('date-url');
$lzhuce="{:I('lzhuce')}";
$phb = "{:I('phb')}";
$dzhuce = "{:I('dzhuce')}";
$wzhuce = "{:I('wzhuce')}";
$mzhuce = "{:I('mzhuce')}";
// $sss="{:I('group')}";
if($ddd=='lzhuce'){
if($lzhuce==1){
$(".sortBy").attr('name','lzhuce');
$(".sortBy").attr('value',2);
$("#search").click();
}else{
$(".sortBy").attr('name','lzhuce');
$(".sortBy").attr('value',1);
$("#search").click();
}
}
if($ddd=='phb'){
if($phb==1){
$(".sortBy").attr('name','phb');
$(".sortBy").attr('value',2);
$("#search").click();
}else{
$(".sortBy").attr('name','phb');
$(".sortBy").attr('value',1);
$("#search").click();
}
}
if($ddd=='dzhuce'){
if($dzhuce==1){
$(".sortBy").attr('name','dzhuce');
$(".sortBy").attr('value',2);
$("#search").click();
}else{
$(".sortBy").attr('name','dzhuce');
$(".sortBy").attr('value',1);
$("#search").click();
}
}
if($ddd=='wzhuce'){
if($wzhuce==1){
$(".sortBy").attr('name','wzhuce');
$(".sortBy").attr('value',2);
$("#search").click();
}else{
$(".sortBy").attr('name','wzhuce');
$(".sortBy").attr('value',1);
$("#search").click();
}
}
if($ddd=='mzhuce'){
if($mzhuce==1){
$(".sortBy").attr('name','mzhuce');
$(".sortBy").attr('value',2);
$("#search").click();
}else{
$(".sortBy").attr('name','mzhuce');
$(".sortBy").attr('value',1);
$("#search").click();
}
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
})
});
// $(".paixu").click(function(){
// $ddd=$(this).attr('date-url');
// $lzhuce="{:I('lzhuce')}";
// $phb = "{:I('phb')}";
// $dzhuce = "{:I('dzhuce')}";
// $wzhuce = "{:I('wzhuce')}";
// $mzhuce = "{:I('mzhuce')}";
// // $sss="{:I('group')}";
// if($ddd=='lzhuce'){
// if($lzhuce==1){
// $(".sortBy").attr('name','lzhuce');
// $(".sortBy").attr('value',2);
// $("#search").click();
// }else{
// $(".sortBy").attr('name','lzhuce');
// $(".sortBy").attr('value',1);
// $("#search").click();
// }
// }
// if($ddd=='phb'){
// if($phb==1){
// $(".sortBy").attr('name','phb');
// $(".sortBy").attr('value',2);
// $("#search").click();
// }else{
// $(".sortBy").attr('name','phb');
// $(".sortBy").attr('value',1);
// $("#search").click();
// }
// }
// if($ddd=='dzhuce'){
// if($dzhuce==1){
// $(".sortBy").attr('name','dzhuce');
// $(".sortBy").attr('value',2);
// $("#search").click();
// }else{
// $(".sortBy").attr('name','dzhuce');
// $(".sortBy").attr('value',1);
// $("#search").click();
// }
// }
// if($ddd=='wzhuce'){
// if($wzhuce==1){
// $(".sortBy").attr('name','wzhuce');
// $(".sortBy").attr('value',2);
// $("#search").click();
// }else{
// $(".sortBy").attr('name','wzhuce');
// $(".sortBy").attr('value',1);
// $("#search").click();
// }
// }
// if($ddd=='mzhuce'){
// if($mzhuce==1){
// $(".sortBy").attr('name','mzhuce');
// $(".sortBy").attr('value',2);
// $("#search").click();
// }else{
// $(".sortBy").attr('name','mzhuce');
// $(".sortBy").attr('value',1);
// $("#search").click();
// }
// }
// })
//点击排序
$('.list_sort').click(function(){
var url = $(this).attr('url');
@ -308,15 +353,17 @@
// endDate:date
})
$("#game_id").change(function(){
console.log($("#game_id option:selected").attr('game-id'));
$.ajax({
url:"{:U('Ajax/getSpendServer')}",
url:"{:U('getSpendServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
str += "<option value='"+data[i].server_id+"'>"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
@ -325,18 +372,20 @@
}
})
});
var game_id = "{:I('game_name')}";
var game_name = "{:I('game_name')}";
var game_server = "{:I('server_id')}";
if(game_id){
if(game_name){
console.log({game_name:game_name})
$.ajax({
url:"{:U('Ajax/getSpendServer')}",
url:"{:U('getSpendServer')}",
type:"post",
data:{game_id:game_id,type:2},
data:{game_name:game_name},
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>"
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);

@ -65,7 +65,7 @@
<label>链接类型:</label>
<select name="link_type">
<option value="0">全部</option>
<option value="1">复制下载链接</option>
<option value="1">下载链接</option>
<option value="2">落地页下载链接</option>
</select>
</div>
@ -130,7 +130,7 @@ $(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Support/lists')}');
highlight_subnav('{:U('Promote/linkInfo')}');
$(function(){
//搜索功能
$("#search").click(function(){

@ -83,7 +83,7 @@
<div class="input-list input-list-spend search_label_rehab">
<select id="pay_way_id" name="pay_way" class="select_gallery" style="width:120px;">
<option value="">充值方式</option>
<volist name=":all_pay_way(1)" id="vo">
<volist name=":all_pay_way_other(1)" id="vo">
<option value="{$vo.key}">{$vo.value}</option>
</volist>
</select>

@ -107,14 +107,14 @@
{$_page|default=''}
</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="Spend/lists">
</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="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="Spend/lists">
</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>

@ -42,7 +42,13 @@ class HomeController extends Controller
$secret = 'd3219c70a45c5e1954be4608b288d38b';
$tokenUrl = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $secret;
$content = file_get_contents(RUNTIME_PATH . 'Data/wechat_ticket');
$tempDataDir = RUNTIME_PATH . 'Data';
if(!is_dir($tempDataDir)) {
@mkdir($tempDataDir);
}
$content = file_get_contents($tempDataDir . '/wechat_ticket');
$ticketData = null;
if ($content) {
$ticketData = json_decode($content, true);
@ -227,7 +233,7 @@ class HomeController extends Controller
}
// 调试
$isIOS = true;
// $isIOS = true;
$downloadUrl = '';
if (!$isNewIos && $isIOS13) {

Loading…
Cancel
Save