Merge remote-tracking branch 'origin/dev' into dev

master
liuweiwen 5 years ago
commit adaa402a14

@ -1748,7 +1748,8 @@ function data2csv(&$data,$title,$fields){
foreach ($data as $row) {
$a = [];
foreach($field as $k=>$v){
$a[$v] = $row[$v] . "\t";//防止格式错误
// $a[$v] = $row[$v] . "\t";//防止格式错误
$a[$v] = $row[$v];
}
if ($index == 10000) { //每次写入1000条数据清除内存
$index = 0;

@ -560,6 +560,27 @@ function getGameByName($game_name=null, $sdk_version=null)
return $result;
}
}
//根据游戏公司,游戏名称,游戏类型
function getGameidByPartnerNameType($partner_id=null,$game_name=null, $sdk_version=null)
{
$map = [];
if($partner_id){
$map['partner_id'] = $partner_id;
}
if ($game_name) {
$map['relation_game_name'] = $game_name;
}
if ($sdk_version) {
$map['sdk_version'] = $sdk_version;
}
$result = D("Game")->field('id')->where($map)->select();
if(empty($result)) {
return [['id' => -1]];
}else
{
return $result;
}
}
function getTopPromote($promote_id)
{

@ -1001,11 +1001,12 @@ class FinanceController extends ThinkController
} elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$time = array('elt', (strtotime($_REQUEST['timeend']) + 86399));
}
setPowerPromoteIds($map);
//获取现金充值
$cashStatistics = M('spend', 'tab_')
->field('pay_way,"" as pay_type,SUM(pay_amount) AS pay_amount')
->where(['pay_status' => 1,'pay_way'=>['egt',1],'pay_time'=>$time])
->where(['pay_status' => 1,'pay_way'=>['egt',1],'pay_time'=>$time,'promote_id'=>$map['promote_id']])
->group('pay_way')
->select();
foreach ($cashStatistics as $key => $value) {
@ -1020,7 +1021,8 @@ class FinanceController extends ThinkController
'tab_deposit.pay_status' => 1,
'tab_deposit.pay_way' => ['gt', 0],
'extend'=>['eq','']
,'tab_deposit.create_time'=>$time
,'tab_deposit.create_time'=>$time,
'tab_deposit.promote_id'=>$map['promote_id']
])->field('tab_deposit.pay_way,"" as pay_type, SUM(tab_deposit.pay_amount) AS balance')
->join("inner join tab_pay_info on tab_pay_info.order_id=tab_deposit.pay_order_number")
->group('tab_deposit.pay_way')
@ -1059,7 +1061,8 @@ class FinanceController extends ThinkController
->where([
'pay_status' => 1,
'pay_way' => ['gt', 0],
'create_time'=>$time
'create_time'=>$time,
'promote_id'=>$map['promote_id']
])
->group('pay_way')
->select();
@ -1084,7 +1087,8 @@ class FinanceController extends ThinkController
->field("pay_way,'' as pay_type,sum(real_amount) as pay_amount")
->where([
'order_status'=>['egt',1],
'pay_way'=>['egt',1],'pay_time'=>$time
'pay_way'=>['egt',1],'pay_time'=>$time,
'promote_id'=>$map['promote_id']
])
->group('pay_way')
->select();
@ -1114,7 +1118,8 @@ class FinanceController extends ThinkController
'pay_status'=>1,
'pay_way'=>['egt',1],
'pay_source'=>0,
'create_time'=>$time
'create_time'=>$time,
'promote_id'=>$map['promote_id']
])
->group('pay_way')
->select();

@ -121,6 +121,7 @@ class FinancePromoteController extends AdminController
}
private function getJoinPromoteData($map,$istimeselect,$type="spend")
{
// setPowerPromoteIds($map,"s.promote_id");
if ($_REQUEST['promote_id'] != '') {
if ($_REQUEST['promote_id'] == 0) {
$map['s.promote_id'] = 0;
@ -276,6 +277,7 @@ class FinancePromoteController extends AdminController
}
private function promoteUserData($map,$istimeselect,$type="spend")
{
// setPowerPromoteIds($map,"s.promote_id");
if ($_REQUEST['promote_id'] != '') {
if ($_REQUEST['promote_id'] == 0) {
$map['s.promote_id'] = 0;
@ -436,14 +438,8 @@ class FinancePromoteController extends AdminController
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
if (!empty(I('partner_id'))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId];
}
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) {
$map["game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
@ -595,18 +591,21 @@ class FinancePromoteController extends AdminController
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
if (!empty(I('partner_id'))&&empty(I("game_id"))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['tab_spend.game_id'] = ['in',$gameId];
}
// if (!empty(I('partner_id'))&&empty(I("game_id"))) {
// $wherePartner = I('partner_id');
// $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
// $gameId = implode(',',array_column($gameId,'id'));
// $map['tab_spend.game_id'] = ['in',$gameId];
// }
if (!empty(I("game_id"))) {
$map['tab_spend.game_id'] = I("game_id");
}
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) {
$map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
// if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
// $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
// }
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];

@ -50,6 +50,9 @@ class PayChannelController extends ThinkController
$map['pay_status'] = $coinMap['pay_status'] = 1;
$map['pay_way'] = array('egt',1);
// setPowerPromoteIds($map,'promote_id');
//游戏币计算
$data = M('spend','tab_')
->field("game_name,sum(pay_amount) as pay_amount,game_id")
@ -61,6 +64,8 @@ class PayChannelController extends ThinkController
//平台币充值金额计算
$coinMap['pay_source'] = 2;
$coinMap['extend'] = array('eq','');
// setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
->field("tab_pay_info.game_name,0 as pay_amount,sum(tab_deposit.pay_amount) as platform_coin,0 as test_coin,tab_pay_info.game_id")
@ -118,15 +123,16 @@ class PayChannelController extends ThinkController
$data[$key]['test_platform_coin'] = $handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0;
}
$superMap = $map;
// unset($superMap['promote_id']);
//超级签数据
$superSignData = M('game_supersign','tab_')
->field("0 as game_name,sum(pay_price) as pay_amount,0 as platform_coin,0 as test_coin")
->where($map)
->where($superMap)
->find();
$testSuperSignCost = M('game_supersign','tab_')
->join("inner join tab_test_white_list on tab_game_supersign.user_id=tab_test_white_list.user_id")
->where($map)
->where($superMap)
->sum('pay_price');
$superSignData['test_coin'] = $testSuperSignCost?$testSuperSignCost:0;
$superSignData['sum'] = $superSignData['pay_amount']?$superSignData['pay_amount']:0;
@ -137,6 +143,7 @@ class PayChannelController extends ThinkController
$offcialmap['pay_status'] = 1;
$offcialmap['pay_way'] = array('egt',1);
$offcialmap['pay_source'] = 0;
// setPowerPromoteIds($offcialmap,'promote_id');
$offcialData = M('deposit','tab_')
->field("id as game_name,sum(pay_amount) as pay_amount,0 as platform_coin,0 as test_coin")
@ -151,6 +158,7 @@ class PayChannelController extends ThinkController
$bindMap['pay_status'] = 1;
$bindMap['pay_way'] = array('egt',1);
// setPowerPromoteIds($bindMap,'promote_id');
$bindRechargeData = M('bind_recharge','tab_')
->field('sum(real_amount) as pay_amount')
@ -165,6 +173,7 @@ class PayChannelController extends ThinkController
$spreadMap['order_status'] = array('egt',1);
$spreadMap['pay_way'] = array('egt',1);
// setPowerPromoteIds($spreadMap,'promote_id');
//推广后台
$spreadData = M("coin_pay_order","tab_")
->field("0 as game_name,sum(real_amount) as pay_amount,0 as platform_coin,id as test_coin")
@ -343,11 +352,13 @@ class PayChannelController extends ThinkController
if($map['pay_time']) {
$spreadMap['create_time'] = $map['pay_time'];
}
// $spreadMap['promote_id'] = $map['promote_id'];
//推广后台
$spreadDataPay = M("coin_pay_order","tab_")
->field("sum(pay_amount) as pay_amount,pay_way")
->where($spreadMap)
->select(false);
if ($map['pay_time']) {
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
@ -367,6 +378,7 @@ class PayChannelController extends ThinkController
if ($map['pay_time']) {
$bindMap['create_time'] = $map['pay_time'];
}
// $bindMap['promote_id'] = $map['promote_id'];
$bindRechargeData = M('bind_recharge','tab_')
->field('sum(real_amount) as pay_amount,pay_way')
@ -439,6 +451,9 @@ class PayChannelController extends ThinkController
$page = $p ? $p : 1; //默认显示第一页数据
// setPowerPromoteIds($map,'promote_id');
// setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$spendData = M('spend','tab_')
->field("pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,cost,pay_amount,pay_way")
->where($map)
@ -454,6 +469,7 @@ class PayChannelController extends ThinkController
->select(false);
$spreadMap['order_status'] = array('egt',1);
// setPowerPromoteIds($spreadMap,'promote_id');
// $spreadMap['pay_way'] = array('egt',1);
$coin_pay_order = M('coin_pay_order','tab_')
->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way")
@ -463,6 +479,7 @@ class PayChannelController extends ThinkController
//官网数据
$offcialmap['pay_status'] = 1;
$offcialmap['pay_source'] = 0;
// setPowerPromoteIds($offcialmap,'promote_id');
$offcialData = M('deposit','tab_')
->field("pay_order_number,create_time as pay_time,user_account,promote_account,pay_ip as spend_ip,pay_amount as cost,pay_amount,pay_way")
@ -478,6 +495,7 @@ class PayChannelController extends ThinkController
unset($map['pay_order_number']);
}
// unset($map['promote_id']);
//超级签数据
$superSignData = M('game_supersign','tab_')
->field("order_id as pay_order_number,pay_time,tab_user.account as user_account,tab_user.promote_account,pay_price as cost,pay_price as pay_amount,pay_way")
@ -601,8 +619,9 @@ class PayChannelController extends ThinkController
$_REQUEST['game_id']?$map['game_id'] = $_REQUEST['game_id']:false;
$_REQUEST['game_id']?$coinMap['game_id'] = $_REQUEST['game_id']:false;
$map['pay_status'] = 1;
// setPowerPromoteIds($map,'promote_id');
// setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
// $_REQUEST['model']?$model= $_REQUEST['model']:false;
if ($_REQUEST['model']) {
@ -624,6 +643,7 @@ class PayChannelController extends ThinkController
->select(false);
$spreadMap['order_status'] = array('egt',1);
// setPowerPromoteIds($spreadMap,'promote_id');
$coin_pay_order = M('coin_pay_order','tab_')
->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way")
@ -633,6 +653,7 @@ class PayChannelController extends ThinkController
//官网数据
$offcialmap['pay_status'] = 1;
$offcialmap['pay_source'] = 0;
// setPowerPromoteIds($offcialmap,'promote_id');
$offcialData = M('deposit','tab_')
->field("pay_order_number,create_time as pay_time,user_account,promote_account,pay_ip as spend_ip,pay_amount as cost,pay_amount,pay_way")
@ -648,6 +669,7 @@ class PayChannelController extends ThinkController
unset($map['pay_order_number']);
}
// unset($map['promote_id']);
//超级签数据
$superSignData = M('game_supersign','tab_')
->field("order_id as pay_order_number,pay_time,tab_user.account as user_account,tab_user.promote_account,pay_price as cost,pay_price as pay_amount,pay_way")
@ -798,7 +820,7 @@ class PayChannelController extends ThinkController
if ($_REQUEST['game_id']) {
$map['game_id'] = $_REQUEST['game_id'];
}
// setPowerPromoteIds($map,'promote_id');
$data = M('spend','tab_')
->field("pay_order_number,order_number,user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status")
->join('inner join tab_test_white_list on tab_spend.user_id=tab_test_white_list.user_id')
@ -811,8 +833,12 @@ class PayChannelController extends ThinkController
}
$coinMap = $map;
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
unset($coinMap['pay_time']);
if ($map['pay_time']) {
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
unset($coinMap['pay_time']);
}
// unset($coinMap['promote_id']);
// setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
@ -822,6 +848,7 @@ class PayChannelController extends ThinkController
tab_deposit.pay_amount,tab_deposit.pay_way as pay_type,tab_deposit.pay_way,'' as pay_game_status")
->where($coinMap)
->select(false);
$page = ($page-1) * $row;
$count = "select count(*) as count from ({$data} UNION ALL {$coinData})t;";
@ -939,6 +966,7 @@ class PayChannelController extends ThinkController
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
}
// setPowerPromoteIds($map,'tab_deposit.promote_id');
$data = M('deposit','tab_')
->field("pay_order_number,order_number,user_account,create_time as pay_time,pay_amount as cost,pay_amount,pay_way as pay_type,pay_way")
->join('inner join tab_test_white_list on tab_deposit.user_id=tab_test_white_list.user_id')
@ -1098,6 +1126,7 @@ class PayChannelController extends ThinkController
if ($_REQUEST['game_id']) {
$map['game_id'] = $_REQUEST['game_id'];
}
// setPowerPromoteIds($map,'promote_id');
$data = M('spend','tab_')
->field("pay_order_number,order_number,user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status")
@ -1112,8 +1141,14 @@ class PayChannelController extends ThinkController
$coinMap = $map;
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
unset($coinMap['pay_time']);
if($map['pay_time']) {
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
unset($coinMap['pay_time']);
}
// unset($coinMap['promote_id']);
// setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
->join("inner join tab_test_white_list on tab_test_white_list.user_id=tab_pay_info.user_id")
@ -1283,6 +1318,7 @@ class PayChannelController extends ThinkController
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
}
// setPowerPromoteIds($map,'tab_deposit.promote_id');
$accessNum = M('deposit','tab_')
->field("pay_order_number,order_number,user_account,create_time as pay_time,pay_amount as cost,pay_amount,pay_way as pay_type,pay_way")
@ -1446,5 +1482,17 @@ class PayChannelController extends ThinkController
fputcsv($fp, $sumDataPay);
}
function getGameList() {
if (I('partner_id')) {
$map['partner_id'] = I('partner_id');
}
if (I('sdk_type')) {
$map['sdk_version'] = I('sdk_type');
}
$data = M('game','tab_')->field("id,game_name")->where($map)->select();
$this->ajaxReturn($data,'json');
}
}

@ -95,6 +95,9 @@
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<div class="input-list search-title-box">
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作公司</option>
@ -127,6 +130,9 @@
</div>
<input type="hidden" name="from" value="{$_GET['from']}"/>
<input type="hidden" name="promote_id" value="{$_GET['promote_id']}"/>
<input type="hidden" name="promote_type" value="{$_GET['promote_type']}"/>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameStatistics','model='.$model['name'].'&row='.I('row'),false)}"
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>

@ -325,12 +325,27 @@
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
// $("#game_type").empty();
}
})
}
//设置设备类型
function gameTypeInit() {
// var game_type = "{:I('game_type')}";
var str = "<option value=''>请选择设备类型</option><option value='1'>安卓</option><option value='2'>苹果</option>";
$("#game_type").empty();
$("#game_type").append(str);
$("#game_type").select2();
}
var seleinit = 0;
$("#partner_id").change(function(){
get_game_list();
if(seleinit > 0){
gameTypeInit();
}
seleinit++;
});
$("#partner_id").change();

@ -222,9 +222,9 @@
<td>
<a
href="{:U('FinancePromote/gameStatistics',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id'],'promote_type'=>1],I('get.')))}">游戏查看</a>
href="{:U('FinancePromote/gameStatistics',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id'],'promote_type'=>1],I('get.'),['p'=>1]))}">游戏查看</a>
<a
href="{:U('FinancePromote/promoteUser',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id']],I('get.')))}">渠道查看</a>
href="{:U('FinancePromote/promoteUser',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id']],I('get.'),['p'=>1]))}">渠道查看</a>
</td>
</tr>
</volist>

@ -87,6 +87,9 @@
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch search_list fl cf">
<div class="input-list search-title-box">
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
</div>
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
@ -209,7 +212,7 @@
<td>
<a href="{:U('FinancePromote/gameStatistics',array_merge(I('get.'),['promote_id'=>$data['promote_id'],'company_id'=>$data['company_id'],'promote_type'=>2]))}" >游戏查看</a>
<a href="{:U('FinancePromote/gameStatistics',array_merge(I('get.'),['promote_id'=>$data['promote_id'],'company_id'=>$data['company_id'],'promote_type'=>2,'p'=>1]))}" >游戏查看</a>
</td>
</tr>
</volist>

@ -101,13 +101,11 @@
<!-- </select>-->
<!-- </div>-->
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" style="width:120px;">
<option value="">请选择游戏</option>
<volist name=":getGameList($_GET['partner_id'])" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq $_GET['game_id']">selected=selected</if>>{$vo.game_name}</option>
</volist>
<select id="game_name" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
</select>
</div>
<div class="input-list">
<input type="text" id="timestart" name="timestart" class="" value="{:I('timestart')}" placeholder="下单开始时间" />
-
@ -280,6 +278,28 @@
});
}
function get_game_list()
{
var game_name = "{:I('game_id')}";
$.ajax({
url:"{:U('PayChannel/getGameList')}",
type:"post",
data:{partner_id:$("#partner_id option:selected").val(), sdk_type:$("#sdk_version1 option:selected").val()},
dataType:'json',
success:function(data){
var str = "<option value=''>请选择游戏</option>";
for (var i in data){
str += "<option value='"+data[i].id+"'"+(game_name && data[i].id == game_name?'selected':'')+">"+data[i].game_name+"</option>"
}
// console.log(str);
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
}
})
}
get_game_list();
$(function(){
$('#timestart').datetimepicker({

@ -10,11 +10,12 @@
<div class="cf main-place top_nav_list navtab_list">
<ul class="tabnav1711 fr jstabnav">
<li data-tab="tab1" class="current"><a href="javascript:void(0);">基本信息</a></li></li>
<li data-tab="tab2" ><a href="javascript:void(0);">结算信息</a></li>
</ul>
<!-- <ul class="tabnav1711 fr jstabnav">-->
<!-- <li data-tab="tab1" class="current"><a href="javascript:void(0);">基本信息</a></li></li>-->
<!-- <li data-tab="tab2" ><a href="javascript:void(0);">结算信息</a></li>-->
<!-- </ul>-->
<h3 class="page_title">{$title}测试账号</h3>
<p class="description_text">说明:此功能是新增测试白名单</p>
</div>

@ -892,5 +892,5 @@ ALTER TABLE `tab_spend`
ADD COLUMN `event_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '事件是否通知';
-- 菜单添加补单记录
INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('补单记录管理', 137, 0, 'BehaviorLog/singleSupplement', 0, '', '游戏订单', 0, 1);

Loading…
Cancel
Save