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

master
chenzhi 5 years ago
commit af05f08689

@ -5359,7 +5359,7 @@ if ($key == 'model'){
$xlsCell = array(
array('game_name','游戏'),
array('collaborate_name','合作方'),
array('partner_name','合作方'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('inside_cash_count','内冲流水'),
@ -5371,13 +5371,65 @@ if ($key == 'model'){
$map['count_date']=I('count_date');
}
if(!empty(I('root_id'))||I('root_id')=='0') {
$root_id = I('root_id');
if ($root_id == '0') {
$map['_string'] = "promote_id = {$root_id}";
} else if($root_id){
$map['_string'] = "promote_id = {$root_id} or parent_id = {$root_id} or root_id = {$root_id}";
}
}
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
}
if (I('sign') == 2&&empty(I('root_id'))) {
$map['_string'] = "parent_id >0 or root_id>0";
}
if (I('sign') == 3&&empty(I('root_id'))) {
$map['_string'] = "parent_id >0 and root_id>0";
}
// var_dump($map);die();
if(!empty(I('parent_id'))) {
$parent_id = I('parent_id');
$map['_string'] = "promote_id = {$parent_id} or parent_id = {$parent_id}";
}
if (!empty(I('promote_id'))) {
$promote_id = I('promote_id');
$map['_string'] = "promote_id = {$promote_id}";
}
$map['bind_coin_count'] = ['neq',0];
$insideData = D("spend_count")->getSpendCountData($map,"game_id,bind_coin_count as count","promote_id,count_date,game_id");
unset($map['bind_coin_count']);
//内充流水与绑定流水数据
$insideDataSum = [];
foreach ($insideData as $key => $value) {
if (isset($insideDataSum[$value['game_id']])) {
$insideDataSum[$value['game_id']] = $insideDataSum[$value['game_id']] + $value['count'];
} else {
$insideDataSum[$value['game_id']] = $value['count'];
}
}
$field = "count_date,sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,
sum(bind_coin_count) as inside_cash_count,sum(cash_count+balance_coin_count+bind_coin_count) as all_cash_count,game_name,collaborate_name";
sum(bind_coin_count) as inside_cash_count,sum(cash_count+balance_coin_count+bind_coin_count) as all_cash_count,game_name,partner_name";
$group = "game_id";
$order = "id DESC";
$xlsData = D("spend_count")->getSpendCountData($map,$field,$group,$order);
foreach ($xlsData as $key => $value) {
$xlsData[$key]['inside_cash_count'] = number_format($insideDataSum[$value['game_id']],2,'.','');
}
$sumCash = D("spend_count")->sumSpendCountField($map,"cash_count");
$sumBalance = D("spend_count")->sumSpendCountField($map,"balance_coin_count");
$sumInside = D("spend_count")->sumSpendCountField($map,"bind_coin_count");
@ -5396,8 +5448,8 @@ if ($key == 'model'){
function gameFinanceDetail() {
$month = I("count_date");
$xlsName = '充值流水';
$month = I("game_name");
$xlsName = $month.'充值流水';
$xlsCell = array(
array('pay_order_number','支付订单号'),
@ -5413,16 +5465,39 @@ if ($key == 'model'){
array('pay_way','充值方式'),
);
if (!empty(I("count_date"))) {
$month = I("count_date");
} else {
$this->error('月份不能为空');
if (!empty(I("promote_id"))) {
$promote_id[] = I("promote_id");
}
if (!empty(I("root_id"))) {
$root_id = I("root_id");
$promote_id = $this->getPromoteList($root_id);
array_push($promote_id,$root_id);
}
if ($_REQUEST['root_id']=='0') {
$map['promote_id'] = $_REQUEST['root_id'];
}
$startTime = strtotime(date("Y-m-01",strtotime($month)));
$endTime = strtotime(date("Y-m-t",strtotime($month)));
if (!empty(I("parent_id"))) {
$parent_id = I("parent_id");
$promote_id = $this->getPromoteList($parent_id);
array_push($promote_id,$parent_id);
}
$map['pay_time'] = array('between',array($startTime,$endTime));
$promote_id = implode(',',$promote_id);
if ($promote_id) {
$map['promote_id'] = ['in',$promote_id];
}
if (!empty(I("count_date"))) {
$month = I("count_date");
$tarry = explode('-',$month);
$startTime=mktime(0,0,0,$tarry[1],1,$tarry[0]);
$endTime =mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1;
$map['pay_time'] = array('between',array($startTime,$endTime));
}
$map['pay_status'] = 1;
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
@ -5440,7 +5515,7 @@ if ($key == 'model'){
$xlsData = D('spend')->getSpendData($map,$field,$group,$order);
foreach($xlsData as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$xlsData[$key]['pay_way'] = getPayType($value['pay_way']);
}
$sum = D('spend')->sumSpend($map,'pay_amount');
@ -5452,6 +5527,22 @@ if ($key == 'model'){
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
function getPromoteList($root_id = 0) {
$data = M('promote','tab_')
->field("id")
->where("parent_id={$root_id} or grand_id={$root_id}")
->select();
$handleData = [];
foreach ($data as $key => $value) {
array_push($handleData,$data[$key]['id']);
}
return $handleData;
}
function exportGetRootUser() {
//获取所有数据
@ -5589,9 +5680,15 @@ if ($key == 'model'){
$parentData = $this->getParentSpendData($parent_id,$month);
$map['parent_id'] =$parent_id;
} else if (!empty(I('sign'))) {
}
if (!empty(I('sign'))) {
$map['parent_id'] = ['neq',0];
$map['root_id'] = ['neq',0];
if (!empty(I('root_id'))) {
$map['root_id'] = I('root_id');
} else {
$map['root_id'] = ['neq',0];
}
}
$xlsName = '推广员月结统计';

@ -83,6 +83,8 @@ class FinanceController extends ThinkController
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '月结统计';
$this->assign('sumCash',$sumCash);
$this->assign('sumBalance',$sumBalance);
$this->assign('sumInside',$sumInside);
@ -104,6 +106,10 @@ class FinanceController extends ThinkController
$map['count_date']=I('count_date');
}
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
}
if(!empty(I('root_id'))||I('root_id')=='0') {
$root_id = I('root_id');
if ($root_id == '0') {
@ -157,7 +163,7 @@ class FinanceController extends ThinkController
// echo D("spend_count")->_sql();die();
foreach ($data as $key => $value) {
$data[$key]['inside_cash_count'] = $insideDataSum[$value['game_id']];
$data[$key]['inside_cash_count'] = number_format($insideDataSum[$value['game_id']],2,'.','');
}
$sumCash = D("spend_count")->sumSpendCountField($map,"cash_count");
@ -171,6 +177,8 @@ class FinanceController extends ThinkController
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '每月情况查看详情';
$this->assign('sumCash',$sumCash);
$this->assign('sumBalance',$sumBalance);
$this->assign('sumInside',$sumInside);
@ -251,6 +259,7 @@ class FinanceController extends ThinkController
$count = count($count);
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '游戏充值流水';
$this->assign('data',$data);
$this->assign('sum_amount',$sum);
@ -300,6 +309,7 @@ class FinanceController extends ThinkController
$count = count($count);
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '会长流水';
$this->assign('sumData',$sumData);
$this->assign('data',$subQueryAll);
@ -372,6 +382,7 @@ class FinanceController extends ThinkController
$count = count($count);
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '组长流水';
$this->assign('sumData',$sumData);
$this->assign('data',$subQueryAll);
@ -440,6 +451,8 @@ class FinanceController extends ThinkController
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '推广员流水';
$sum = array_sum($sumData);
$this->assign('sumData',$sumData);
@ -468,6 +481,8 @@ class FinanceController extends ThinkController
if (I('partner_id')) {
$map['partner_id'] = I('partner_id');
} else {
$this->ajaxReturn([],'json');
}
$data = M('game','tab_')->field("id,game_name")->where($map)->select();

@ -41,9 +41,9 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="{:U('Finance/index')}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/exportGameFinance',
array('count_date'=>$_GET['count_date'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
array('count_date'=>$_GET['count_date'],'root_id'=>$_GET['root_id'],'parent_id'=>$_GET['parent_id'],'promote_id'=>$_GET['promote_id'],'game_id'=>$_REQUEST['game_id'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
</div>
</div>
@ -107,7 +107,7 @@
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td>
<a href="{:U('Finance/gameFinanceDetail',
array('count_date'=>$_REQUEST['count_date'],'root_id'=>$_GET['root_id'],'parent_id'=>$_REQUEST['parent_id'],'promote_id'=>$_REQUEST['promote_id']))}" >查看</a>
array('count_date'=>$_REQUEST['count_date'],'root_id'=>$_GET['root_id'],'parent_id'=>$_REQUEST['parent_id'],'promote_id'=>$_REQUEST['promote_id'],'game_id'=>$_REQUEST['game_id']))}" >查看</a>
</td>
</tr>
</notemtpy>

@ -41,9 +41,9 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="{:U('Finance/gameFinance',array('count_date'=>$_GET['count_date']))}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/gameFinanceDetail',
array('count_date'=>$_GET['count_date'],'game_id'=>$_GET['game_id'],'game_name'=>$_GET['game_name'],'user_account'=>$_GET['user_account'],'user_nickname'=>$_GET['user_nickname'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
array('count_date'=>$_GET['count_date'],'game_id'=>$_GET['game_id'],'game_name'=>$_GET['game_name'],'user_account'=>$_GET['user_account'],'user_nickname'=>$_GET['user_nickname'],'parent_id'=>$_GET['parent_id'],'root_id'=>$_GET['root_id'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/>
<input type="hidden" name="game_id" value="{$_GET['game_id']}"/>

@ -30,7 +30,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$_REQUEST['game_name']}充值流水</h3>
<h3 class="page_title">组长月结统计</h3>
<p class="description_text"></p>
</div>
@ -41,15 +41,15 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="{:U('Finance/getRootUser',array('count_date'=>$_GET['count_date'],'root_id'=>$_GET['root_id']))}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/exportGetParentUser',
array('count_date'=>$_GET['count_date'],'root_name'=>$_GET['root_name'],'root_id'=>$_GET['root_id'],'sign'=>1,'',false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
array('count_date'=>$_GET['count_date'],'root_name'=>$_GET['root_name'],'root_id'=>$_GET['root_id'],'',false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
<input type="hidden" name="root_id" value="{$_GET['root_id']}"/>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/>
<div class="input-list">
<input type="text" name="root_name" placeholder="请输入长账号搜索" class="" value="{:I('root_name')}"/>&nbsp;
<input type="text" name="root_name" placeholder="请输入长账号搜索" class="" value="{:I('root_name')}"/>&nbsp;
</div>
<div class="input-list">
@ -67,7 +67,7 @@
<!-- 表头 -->
<thead>
<tr>
<th >长渠道</th>
<th >长渠道</th>
<th>游戏现金流水</th>
@ -114,8 +114,10 @@
<td ><span>{$sumData.balance_coin_count}</span></td>
<td ><span>{$sumData.inside_cash_count}</span></td>
<td ><span>{$sumData.all_count}</span></td>
<td ><a href="{:U('Finance/gameFinance',array('count_date'=>$_GET['count_date'],'sign'=>2,'root_id'=>$_GET['root_id']))}" >游戏查看</a>
<a href="{:U('Finance/getPromoteUser',array('count_date'=>$_GET['count_date'],'root_id'=>$_GET['root_id'],'sign'=>1))}" >渠道查看</a></td>
<td >
<a href="{:U('Finance/gameFinance',array('count_date'=>$_GET['count_date'],'root_id'=>$_GET['root_id']))}" >游戏查看</a>
<!-- <a href="{:U('Finance/getPromoteUser',array('count_date'=>$_GET['count_date'],'root_id'=>$_GET['root_id'],'sign'=>1))}" >渠道查看</a>-->
</td>
</tr>
</notemtpy>

@ -30,7 +30,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$_REQUEST['game_name']}充值流水</h3>
<h3 class="page_title">推广员月结统计</h3>
<p class="description_text"></p>
</div>
@ -41,9 +41,9 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="{:U('Finance/getParentUser',array('count_date'=>$_GET['count_date'],'root_id'=>$_GET['root_id']))}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/exportGetPromoteUser',
array('count_date'=>$_GET['count_date'],'parent_id'=>$_GET['parent_id'],'sign'=>1,false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
array('count_date'=>$_GET['count_date'],'parent_id'=>$_GET['parent_id'],'root_id'=>$_GET['root_id'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/>
<input type="hidden" name="game_id" value="{$_GET['game_id']}"/>

@ -30,7 +30,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$_REQUEST['game_name']}充值流水</h3>
<h3 class="page_title">会长月结统计</h3>
<p class="description_text"></p>
</div>
@ -41,7 +41,7 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="{:U('Finance/index')}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/exportGetRootUser',
array('count_date'=>$_GET['count_date'],'root_name'=>$_GET['root_name'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
@ -112,7 +112,7 @@
<td ><span>{$sumData.inside_cash_count}</span></td>
<td ><span>{$sumData.all_count}</span></td>
<td ><a href="{:U('Finance/gameFinance',array('count_date'=>$_GET['count_date'],'sign'=>1))}" >游戏查看</a>
<a href="{:U('Finance/getParentUser',array('count_date'=>$_GET['count_date'],'root_name'=>$_GET['root_name'],'sign'=>1))}" >渠道查看</a></td>
<!-- <a href="{:U('Finance/getParentUser',array('count_date'=>$_GET['count_date'],'root_name'=>$_GET['root_name'],'sign'=>1))}" >渠道查看</a></td>-->
</tr>
</notemtpy>

@ -93,7 +93,7 @@
<th >平台币流水</th>
<th >内冲流水</th>
<th ><if condition="$_GET['game_id'] neq ''">绑定币流水<else/>内充流水</if></th>
<th >总流水</th>
@ -136,7 +136,7 @@
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td>
<a href="{:U('Finance/gameFinance',array('sign'=>1))}" >游戏查看</a>
<a href="{:U('Finance/gameFinance',array('sign'=>1,'game_id'=>$_GET['game_id']))}" >游戏查看</a>
<a href="{:U('Finance/getRootUser')}" >渠道查看</a>
</td>
</tr>

Loading…
Cancel
Save