游戏统计 游戏名称不含设备类型优化

master
chenzhi 5 years ago
parent 2b7f434955
commit 9064fc7c58

@ -886,3 +886,8 @@ function getSDKTypeName($sdkType, $chinese = false)
return $sdkName;
}
//游戏名称取消 (安卓版),(苹果版)
function clearGameNameType($game_name)
{
return preg_replace("/\(.*\)/","",$game_name);
}

@ -8010,6 +8010,7 @@ class ExportController extends Controller
array('pay_time','充值时间'),
array('user_account','玩家账号'),
array('game_name','游戏名称'),
array('sdk_version','设备名称'),
array('server_name','游戏区服'),
array('game_player_name','角色名称'),
array('cost','订单金额'),
@ -8074,7 +8075,7 @@ class ExportController extends Controller
$map['tab_spend.game_player_name'] = array('like',I("user_nickname").'%');
}
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,tab_spend.user_account,
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,tab_spend.sdk_version,
game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
@ -8096,6 +8097,8 @@ class ExportController extends Controller
foreach($xlsData as $key => $value) {
$xlsData[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$xlsData[$key]['sdk_version'] =$xlsData[$key]['sdk_version'] == 1 ? "安卓" : "苹果";
}
$map['pay_game_status'] = 1;

@ -836,14 +836,41 @@ class FinanceController extends ThinkController
$map['game_player_name'] = array('like',I("user_nickname").'%');
}
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version";
$group = "";
$order = "pay_time DESC";
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
if(isset($_REQUEST['export'])){
$data = D('spend')->getSpendData($map,$field,$group,0,0,$row);
}else{
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
}
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果";
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
}
if(isset($_REQUEST['export'])){
//操作日志
$GetData = $_GET;
unset($GetData['export']);
$dcop = array(
"pay_order_number"=>"支付订单号",
"pay_time"=>"充值时间",
"user_account"=>"玩家账号",
"game_name"=>"游戏名称",
"sdk_version"=>"设备类型",
"promote_account"=>"所属推广员",
"spend_ip"=>"充值ip",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式"
);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-订单查看-导出"]);
data2csv($data,"游戏统计订单查看",$dcop);
}
$totalData = D('spend')->totalGameStatistics($map, false);
@ -937,7 +964,7 @@ class FinanceController extends ThinkController
}
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,tab_spend.user_account,
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,tab_spend.sdk_version,
game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
@ -949,16 +976,46 @@ class FinanceController extends ThinkController
$field2 = $field . ',balance';
$join = 'left join tab_user as u on u.id = tab_spend.user_id';
}
$data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join);
if(isset($_REQUEST['export'])){
$data = D('spend')->getSpendData($map, $field2, $group, $order, 0, 0, $join);
}else{
$data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join);
}
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果";
$data[$key]['cost'] = number_format($value['cost'],2,'.','');
$data[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
}
if(isset($_REQUEST['export'])){
//操作日志
$GetData = $_GET;
unset($GetData['export']);
$dcop = array(
"pay_order_number"=>"支付订单号",
"pay_time"=>"充值时间",
"user_account"=>"玩家账号",
"game_name"=>"游戏名称",
"sdk_version"=>"设备名称",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式"
);
if ($map['pay_way'] ==-1) {
$title = "内充支出明细";
$dcop["bind_balance"]="绑定币余额";
} elseif ($map['pay_way'] ==0) {//平台币
$title = "平台币直充明细";
$dcop["balance"]="平台币余额";
}
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-{$title}-导出"]);
data2csv($data,$title,$dcop);
}
$count = D("spend")->getSpendData($map,$field,$group,$order);
$count = count($count);
$page = set_pagination($count,$row);

@ -50,16 +50,7 @@
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Finance/coinDetail','model='.$model['name'].'&row='.I('row'),false)}"
style="">搜索</a>
<if condition="$_GET['all'] neq 1">
<a class="sch-btn" href="{:U('Export/coinDetail',
array(
'game_id'=>$_GET['game_id'],
'game_name'=>$_GET['game_name'],
'pay_way'=>$_GET['pay_way'],
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'user_account'=>$_GET['user_account'],
'pay_order_number'=>$_GET['pay_order_number'],
false))}">导出</a>
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
</if>
</div>
</div>
@ -76,6 +67,7 @@
<th>充值时间</th>
<th >玩家账号</th>
<th >游戏名称</th>
<th >设备名称</th>
<th >游戏区服</th>
<th >角色名称</th>
<th >订单金额</th>
@ -94,6 +86,7 @@
<td >{$data.pay_time}</td>
<td >{$data.user_account}</td>
<td >{$data.game_name}</td>
<td >{$data.sdk_version}</td>
<td >{$data.server_name}</td>
<td >{$data.game_player_name}</td>
<td >{$data.cost}</td>
@ -108,7 +101,7 @@
</tr>
</volist>
<tr>
<td colspan="6" ><span>总计</span></td>
<td colspan="7" ><span>总计</span></td>
<td ><span><if condition="$total_cost neq ''">{$total_cost}<else/>0.00</if></span></td>
<td><if condition="$total_pay_amount neq ''">{$total_pay_amount}<else/>0.00</if></td>
<td colspan="2"> </td>

@ -93,16 +93,7 @@
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Finance/gameStatisticsDetail','model='.$model['name'].'&row='.I('row'),false)}"
style="">搜索</a>
<if condition="$_GET['all'] neq 1">
<a class="sch-btn" href="{:U('Export/gameStatisticsDetail',
array(
'game_id'=>$_GET['game_id'],
'game_name'=>$_GET['game_name'],
'pay_way'=>$_GET['pay_way'],
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'user_account'=>$_GET['user_account'],
'pay_order_number'=>$_GET['pay_order_number'],
false))}">导出</a>
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
</if>
</div>
</div>
@ -123,6 +114,7 @@
<th >玩家账号</th>
<th >游戏名称</th>
<th >设备类型</th>
<th >所属推广员</th>
@ -158,6 +150,7 @@
<td >{$data.pay_time}</td>
<td >{$data.user_account}</td>
<td >{$data.game_name}</td>
<td >{$data.sdk_version}</td>
<td >{$data.promote_account}</td>
<td >{$data.spend_ip}</td>
<td >{$data.server_name}</td>

Loading…
Cancel
Save