财务管理功能代码完善

master
zyx 5 years ago
parent 82323a7138
commit ee5dccfaeb

@ -1498,4 +1498,16 @@ function getPartner() {
}
function getGameList($partner_id) {
if ($partner_id) {
$map['partner_id'] = $partner_id;
} else {
return [];
}
$data = M('game','tab_')->field("id,game_name")->where($map)->select();
return $data;
}
?>

@ -5457,9 +5457,9 @@ if ($key == 'model'){
//获取所有数据
if (!empty(I("count_date"))) {
$map['count_date'] = I("count_date");
} else {
$this->error('月份不能为空');
}
$xlsName = '会长月结统计';
$xlsCell = array(
@ -5506,14 +5506,26 @@ if ($key == 'model'){
if (!empty(I("count_date")) ) {
$month = I("count_date");
$map['count_date'] =$month;
} else {
$this->error('参数错误');
}
if (!empty(I("root_id")) || I("root_id") == 0) {
$parentData = [];
if (!empty(I("root_id"))) {
$root_id = I("root_id");
$parentData = $this->getParentSpendData($root_id,$month);
$map['parent_id'] =$root_id;
} else if(!empty(I("sign"))){
$map['parent_id'] = ['neq',0];
$map['root_id'] = ['eq',0];
} else {
$this->error('参数错误');
if (I("root_id") == 0) {
$root_id = I("root_id");
$map['promote_id'] = $root_id;
}
}
if (!empty(I("root_name"))) {
@ -5531,7 +5543,7 @@ if ($key == 'model'){
);
//获取数据
$map['parent_id'] =$root_id;
// $map['parent_id'] =$root_id;
$xlsData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
@ -5539,10 +5551,16 @@ if ($key == 'model'){
->group('promote_id')
->select();
$xlsData = array_merge($parentData,$xlsData);
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
$sumData = [['promote_account'=>'总计',
'cash_count'=>$sumData['cash_count'],
@ -5561,17 +5579,25 @@ if ($key == 'model'){
//获取所有数据
if (!empty(I("count_date")) && !empty(I("parent_id"))) {
$month = I("count_date");
$map['count_date'] =$month;
}
$parentData = [];
if (!empty(I("parent_id"))) {
$parent_id = I("parent_id");
$parentData = $this->getParentSpendData($parent_id,$month);
$map['parent_id'] =$parent_id;
$map['count_date'] =$month;
} else {
$this->error('参数错误');
} else if (!empty(I('sign'))) {
$map['parent_id'] = ['neq',0];
$map['root_id'] = ['neq',0];
}
$xlsName = '推广员月结统计';
$xlsCell = array(
array('promote_id','推广员渠道'),
array('promote_account','推广员渠道'),
array('cash_count','游戏现金流水'),
array('balance_coin_count','平台币流水'),
array('inside_cash_count','内充流水'),
@ -5585,12 +5611,18 @@ if ($key == 'model'){
->group('promote_id')
->select();
$xlsData = array_merge($parentData,$xlsData);
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
$sumData = [['promote_id'=>'总计',
$sumData = [['promote_account'=>'总计',
'cash_count'=>$sumData['cash_count'],
'balance_coin_count'=>$sumData['balance_coin_count'],
'inside_cash_count'=>$sumData['inside_cash_count'],
@ -5602,4 +5634,55 @@ if ($key == 'model'){
}
function getParentSpendData($root_id,$date) {
$data = [];
if (!$root_id) {
$this->error('数据错误');
} else {
$map = [];
if ($root_id) {
$map['promote_id'] = $root_id;
}
if ($date) {
$map['count_date'] = $date;
}
$data = M('spend_count','tab_')
->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(cash_count+balance_coin_count) as all_count')
->where($map)->select();
$map['inside_cash_count'] = ['neq',0];
$insideData = D("spend_count")->getSpendCountData($map,"promote_id,inside_cash_count as count","promote_id,count_date");
unset($map['bind_coin_count']);
//内充流水与绑定流水数据
$insideDataSum = 0;
foreach ($insideData as $key => $value) {
if (isset($insideDataSum)) {
$insideDataSum = $insideDataSum + $value['count'];
} else {
$insideDataSum = $value['count'];
}
}
}
if (!$data[0]['cash_count']&&!$data[0]['balance_coin_count']&&!$data[0]['inside_cash_count']&&!$data[0]['all_count']) {
$promoteData = M('promote','tab_')->field('account as promote_account')->where("id={$root_id}")->find();
$data[0]['promote_id'] = $root_id;
$data[0]['promote_account'] = $promoteData['promote_account'];
$data[0]['cash_count'] = number_format(0.00,2,'.','');
$data[0]['balance_coin_count'] = number_format(0.00,2,'.','');
$data[0]['inside_cash_count'] = number_format(0.00,2,'.','');
$data[0]['all_count'] = number_format(0.00,2,'.','');
}
$data[0]['inside_cash_count'] = number_format($insideDataSum,2,'.','');
$data[0]['all_count'] = number_format($insideDataSum+$data[0]['all_count'],2,'.','');
// var_dump($data);die();
return $data;
}
}

@ -104,14 +104,25 @@ class FinanceController extends ThinkController
$map['count_date']=I('count_date');
}
if(!empty(I('root_id'))||!I('sign')) {
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 == '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 (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}";
@ -122,9 +133,6 @@ class FinanceController extends ThinkController
$map['_string'] = "promote_id = {$promote_id}";
}
// var_dump($map);die();
$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']);
@ -144,6 +152,7 @@ class FinanceController extends ThinkController
$group = "game_id";
$order = "id DESC";
$data = D("spend_count")->getSpendCountData($map,$field,$group,$order,$page,$row);
// echo D("spend_count")->_sql();die();
// echo D("spend_count")->_sql();die();
@ -176,15 +185,17 @@ class FinanceController extends ThinkController
function gameFinanceDetail($p = 1) {
if (!empty(I("promote_id"))) {
$promote_id = 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);
} else if (I("root_id")==0) {
$promote_id = 0;
}
if ($_REQUEST['root_id']=='0') {
$map['promote_id'] = $_REQUEST['root_id'];
}
if (!empty(I("parent_id"))) {
@ -193,7 +204,11 @@ class FinanceController extends ThinkController
array_push($promote_id,$parent_id);
}
dump($promote_id);die();
$promote_id = implode(',',$promote_id);
if ($promote_id) {
$map['promote_id'] = ['in',$promote_id];
}
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
@ -202,16 +217,12 @@ class FinanceController extends ThinkController
if (!empty(I("count_date"))) {
$month = I("count_date");
} else {
$this->error('月份不能为空');
$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));
}
$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");
@ -222,11 +233,12 @@ class FinanceController extends ThinkController
if (!empty(I('user_nickname'))) {
$map['user_nickname'] = array('like',I("user_nickname").'%');
}
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
// echo D("spend")->_sql();die();
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
@ -259,9 +271,8 @@ class FinanceController extends ThinkController
//获取所有数据
if (!empty(I("count_date"))) {
$map['count_date'] = I("count_date");
} else {
$this->error('月份不能为空');
}
if (!empty(I("root_name"))) {
$map['promote_account']=['like','%'.I("root_name").'%'];
}
@ -306,16 +317,15 @@ class FinanceController extends ThinkController
$month = I("count_date");
$map['count_date'] =$month;
} else {
$this->error('参数错误');
}
$parentData = [];
if (!empty(I("root_id"))) {
$root_id = I("root_id");
if ($page == 1) {
$parentData = $this->getParentSpendData($root_id,$month);
}
$map['parent_id'] =$root_id;
} else if(!empty(I("sign"))){
@ -324,7 +334,8 @@ class FinanceController extends ThinkController
} else {
if (I("root_id") == 0) {
$this->display();
$root_id = I("root_id");
$map['promote_id'] = $root_id;
}
}
@ -341,10 +352,16 @@ class FinanceController extends ThinkController
->page($page,$row)
->select();
$subQueryAll = array_merge($parentData,$subQueryAll);
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
$count = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
@ -371,20 +388,30 @@ class FinanceController extends ThinkController
if (!empty(I("count_date"))) {
$month = I("count_date");
$map['count_date'] =$month;
} else {
$this->error('参数错误');
}
$parentData = [];
if (!empty(I("parent_id"))) {
$parent_id = I("parent_id");
if ($page == 1) {
$parentData = $this->getParentSpendData($parent_id,$month);
}
$map['parent_id'] =$parent_id;
}
if (!empty(I('sign'))) {
$map['parent_id'] = ['neq',0];
$map['root_id'] = I("root_id");
if (!empty(I('root_id'))) {
$map['root_id'] = I('root_id');
} else {
$map['root_id'] = ['neq',0];
}
}
// var_dump($map);die();
// var_dump($map);die();
$subQueryAll = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
@ -392,10 +419,16 @@ class FinanceController extends ThinkController
->page($page,$row)
->select();
$subQueryAll = array_merge($parentData,$subQueryAll);
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
$count = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
@ -431,4 +464,66 @@ class FinanceController extends ThinkController
}
function getGameList() {
if (I('partner_id')) {
$map['partner_id'] = I('partner_id');
}
$data = M('game','tab_')->field("id,game_name")->where($map)->select();
$this->ajaxReturn($data,'json');
}
function getParentSpendData($root_id,$date) {
$data = [];
if (!$root_id) {
$this->error('数据错误');
} else {
$map = [];
if ($root_id) {
$map['promote_id'] = $root_id;
}
if ($date) {
$map['count_date'] = $date;
}
$data = M('spend_count','tab_')
->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(cash_count+balance_coin_count) as all_count')
->where($map)->select();
$map['inside_cash_count'] = ['neq',0];
$insideData = D("spend_count")->getSpendCountData($map,"promote_id,inside_cash_count as count","promote_id,count_date");
unset($map['bind_coin_count']);
//内充流水与绑定流水数据
$insideDataSum = 0;
foreach ($insideData as $key => $value) {
if (isset($insideDataSum)) {
$insideDataSum = $insideDataSum + $value['count'];
} else {
$insideDataSum = $value['count'];
}
}
}
if (!$data[0]['cash_count']&&!$data[0]['balance_coin_count']&&!$data[0]['inside_cash_count']&&!$data[0]['all_count']) {
$promoteData = M('promote','tab_')->field('account as promote_account')->where("id={$root_id}")->find();
$data[0]['promote_id'] = $root_id;
$data[0]['promote_account'] = $promoteData['promote_account'];
$data[0]['cash_count'] = number_format(0.00,2,'.','');
$data[0]['balance_coin_count'] = number_format(0.00,2,'.','');
$data[0]['inside_cash_count'] = number_format(0.00,2,'.','');
$data[0]['all_count'] = number_format(0.00,2,'.','');
}
$data[0]['inside_cash_count'] = number_format($insideDataSum,2,'.','');
$data[0]['all_count'] = number_format($insideDataSum+$data[0]['all_count'],2,'.','');
// var_dump($data);die();
return $data;
}
}

@ -95,7 +95,7 @@
<td >
<a href="{:U('Finance/gameFinanceDetail',
array('count_date'=>$_REQUEST['count_date'],'game_id'=>$data['game_id'],
'game_name'=>$data['game_name'],'root_id'=>$_REQUEST['root_id'],'parent_id'=>$_REQUEST['parent_id']))}" >查看</a>
'game_name'=>$data['game_name'],'root_id'=>$_REQUEST['root_id'],'parent_id'=>$_REQUEST['parent_id'],'promote_id'=>$_REQUEST['promote_id']))}" >查看</a>
</td>
</tr>
</volist>
@ -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']))}" >查看</a>
array('count_date'=>$_REQUEST['count_date'],'root_id'=>$_GET['root_id'],'parent_id'=>$_REQUEST['parent_id'],'promote_id'=>$_REQUEST['promote_id']))}" >查看</a>
</td>
</tr>
</notemtpy>

@ -43,7 +43,7 @@
<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="{:U('Export/exportGetParentUser',
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>
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>
</div>
<input type="hidden" name="root_id" value="{$_GET['root_id']}"/>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/>
@ -101,8 +101,12 @@
<td >{$data.balance_coin_count}</td>
<td >{$data.inside_cash_count}</td>
<td >{$data.all_count}</td>
<td ><a href="{:U('Finance/gameFinance',array('parent_id'=>$data['promote_id'],'count_date'=>$_GET['count_date']))}" >游戏查看</a>
<a href="{:U('Finance/getPromoteUser',array('count_date'=>$_GET['count_date'],'parent_id'=>$data['promote_id'],'root_id'=>$_GET['root_id']))}" >渠道查看</a></td>
<td ><if condition="$data['promote_id'] neq $_GET['root_id']">
<a href="{:U('Finance/gameFinance',array('parent_id'=>$data['promote_id'],'count_date'=>$_GET['count_date']))}" >游戏查看</a>
<a href="{:U('Finance/getPromoteUser',array('count_date'=>$_GET['count_date'],'parent_id'=>$data['promote_id'],'root_id'=>$_GET['root_id']))}" >渠道查看</a>
<else/>
-------
</if></td>
</volist>
<tr>
<td ><span>总计</span></td>
@ -110,7 +114,7 @@
<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('sign'=>1,'root_id'=>$_GET['root_id']))}" >游戏查看</a>
<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>
</tr>
</notemtpy>

@ -43,7 +43,7 @@
<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="{:U('Export/exportGetPromoteUser',
array('count_date'=>$_GET['count_date'],'parent_id'=>$_GET['root_id'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
array('count_date'=>$_GET['count_date'],'parent_id'=>$_GET['parent_id'],'sign'=>1,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']}"/>
@ -93,7 +93,11 @@
<td >{$data.balance_coin_count}</td>
<td >{$data.inside_cash_count}</td>
<td >{$data.all_count}</td>
<td ><a href="{:U('Finance/gameFinance',array('promote_id'=>$data['promote_id'],'count_date'=>$_GET['count_date']))}" >游戏查看</a></td>
<td ><if condition="$data['promote_id'] neq $_GET['parent_id']">
<a href="{:U('Finance/gameFinance',array('promote_id'=>$data['promote_id'],'count_date'=>$_GET['count_date']))}" >游戏查看</a>
<else/>
-------
</if></td>
</volist>
<tr>
<td ><span>总计</span></td>
@ -101,7 +105,7 @@
<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')}" >游戏查看</a>
<td ><a href="{:U('Finance/gameFinance',array('count_date'=>$_GET['count_date'],'parent_id'=>$_GET['parent_id'],'sign'=>3))}" >游戏查看</a>
</tr>
</notemtpy>

@ -111,7 +111,7 @@
<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('sign'=>1))}" >游戏查看</a>
<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>
</tr>
</notemtpy>

@ -48,22 +48,23 @@
</volist>
</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=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['game_id']">selected=selected</if>>{$vo.game_name}</option>
</volist>
</select>
</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>
<volist name=":getPartner()" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
<option partner-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</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>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Finance/index','model='.$model['name'].'&row='.I('row'),false)}"
@ -121,7 +122,7 @@
<td >{$data.all_cash_count}</td>
<td >
<a href="{:U('Finance/gameFinance',
array('count_date'=>$data['count_date'],'game_id'=>$_GET['game_id'],'collaborate_id'=>$_GET['collaborate_id']))}" >游戏查看</a>
array('count_date'=>$data['count_date'],'game_id'=>$_GET['game_id'],'collaborate_id'=>$_GET['collaborate_id'],'sign'=>1))}" >游戏查看</a>
<a href="{:U('Finance/getRootUser',
array('count_date'=>$data['count_date'])
,false)}" >渠道查看</a>
@ -135,8 +136,8 @@
<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')}" >游戏查看</a>
<a href="{:U('Finance/gameFinance')}" >渠道查看</a>
<a href="{:U('Finance/gameFinance',array('sign'=>1))}" >游戏查看</a>
<a href="{:U('Finance/getRootUser')}" >渠道查看</a>
</td>
</tr>
</notemtpy>
@ -207,20 +208,21 @@
});
});
$("#game_id").change(function(){
$("#partner_id").change(function(){
$.ajax({
url:"{:U('Ajax/getSpendServer')}",
url:"{:U('Finance/getGameList')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
data:{partner_id:$("#partner_id option:selected").attr('partner-id')},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
var 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].id+"'>"+data[i].game_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
console.log(str);
$("#game_id").empty();
$("#game_id").append(str);
// $("#server_id").select2();
}
})

Loading…
Cancel
Save