Merge branch 'feature/ylw-06-17' of wmtx/platform into release

任务567、任务566
master
廖金灵 5 years ago committed by Gogs
commit 849731fd2a

@ -1068,7 +1068,6 @@ class ExportController extends Controller
); );
break; break;
case 7: case 7:
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart']; $startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend']; $endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
@ -1174,7 +1173,7 @@ class ExportController extends Controller
$xlsCell = array( $xlsCell = array(
"支付订单号","CP订单号", "充值时间","支付时间", "玩家账号", "游戏名称", L('Subordinate_channel'), "充值ip","区服ID", "游戏区服", "支付订单号","CP订单号", "充值时间","支付时间", "玩家账号", "游戏名称", L('Subordinate_channel'), '所属推广公司', "充值ip","区服ID", "游戏区服",
"角色ID","角色名称", "订单金额", "实付金额", "充值方式", L('Order_status'), "游戏通知状态", "消费"."{$total}" "角色ID","角色名称", "订单金额", "实付金额", "充值方式", L('Order_status'), "游戏通知状态", "消费"."{$total}"
); );
@ -1206,13 +1205,21 @@ class ExportController extends Controller
// ->join($tab_promote_join) // ->join($tab_promote_join)
// ->order('pay_time DESC') // ->order('pay_time DESC')
// ->select(); // ->select();
->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, 0 as company_name, spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status, promote_id')
// ->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left')
// ->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left')
->where($map) ->where($map)
->limit(($i-1)*$perSize ,$perSize) ->limit(($i-1)*$perSize ,$perSize)
->order($order ? $order : 'pay_time desc') ->order($order ? $order : 'pay_time desc')
->select(); ->select();
$promoters = D('Promote')->where(['id'=>['in', array_unique(array_column($xlsData, 'promote_id'))]])->field('id, company_id')->select();
$promoters = $promoters ? array_column($promoters, 'company_id', 'id') : [];
$companys = $promoters ? M('promote_company', 'tab_')->where(['id'=>['in', array_unique(array_values($promoters))]])->field('id, company_name')->select() : [];
$companys = $companys ? array_column($companys, 'company_name', 'id') : [];
foreach($xlsData as $value) { foreach($xlsData as $value) {
$value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? '');
unset($value['promote_id']);
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
if($value['pay_status'] == 1) { if($value['pay_status'] == 1) {
$value['payed_time'] = date('Y-m-d H:i:s',$value['payed_time']); $value['payed_time'] = date('Y-m-d H:i:s',$value['payed_time']);

@ -1220,6 +1220,7 @@ class FinanceController extends ThinkController
} }
foreach ($cashStatistics as $key => $value) { foreach ($cashStatistics as $key => $value) {
$cashStatistics[$key]['pay_rate'] = '';
$cashStatistics[$key]['total'] = $value['pay_amount'] + $value['balance'];//添加列表合计 $cashStatistics[$key]['total'] = $value['pay_amount'] + $value['balance'];//添加列表合计
} }
@ -1236,11 +1237,12 @@ class FinanceController extends ThinkController
foreach($cashStatistics as $key =>$value) { foreach($cashStatistics as $key =>$value) {
unset($cashStatistics[$key]['pay_way']); unset($cashStatistics[$key]['pay_way']);
$cashStatistics[$key]['pay_rate'] = strval(round($value['total']/$all_total, 4)*100) . "%";
} }
db2csv(array_merge($cashStatistics, db2csv(array_merge($cashStatistics,
[0=>['pay_type'=>'总计','pay_amount'=>$all_pay_amount,'balance'=>$all_balance,'total'=>$all_total]]),'平台统计' [0=>['pay_type'=>'总计','pay_amount'=>$all_pay_amount,'balance'=>$all_balance, 'pay_rate'=>'', 'total'=>$all_total]]),'平台统计'
,['支付方式','现金充值','平台币充值','合计']); ,['支付方式','现金充值','平台币充值', '支付方式占比', '合计']);
} }
$this->checkListOrCountAuthRestMap($map,[]); $this->checkListOrCountAuthRestMap($map,[]);

@ -123,6 +123,7 @@
<th>充值方式</th> <th>充值方式</th>
<th >现金充值</th> <th >现金充值</th>
<th >平台币充值</th> <th >平台币充值</th>
<th >充值方式占比</th>
<th >合计</th> <th >合计</th>
</tr> </tr>
</thead> </thead>
@ -144,6 +145,7 @@
<td ><if condition="$data.pay_type neq ''"><if condition="$data.pay_type eq '微信(扫码)'"> 微信<else/>{$data.pay_type}</if><else/></if></td> <td ><if condition="$data.pay_type neq ''"><if condition="$data.pay_type eq '微信(扫码)'"> 微信<else/>{$data.pay_type}</if><else/></if></td>
<td ><if condition="$data.pay_amount neq ''">{$data.pay_amount}<else/></if></td> <td ><if condition="$data.pay_amount neq ''">{$data.pay_amount}<else/></if></td>
<td ><if condition="$data.balance neq ''">{$data.balance}<else/>0</if></td> <td ><if condition="$data.balance neq ''">{$data.balance}<else/>0</if></td>
<td ><?php echo round($data['total']/$all_total, 4)*100 ?? 0;?>%</td>
<td ><if condition="$data.total neq ''">{$data.total}<else/>0</if></td> <td ><if condition="$data.total neq ''">{$data.total}<else/>0</if></td>
</tr> </tr>
</volist> </volist>
@ -151,6 +153,7 @@
<td><span>总计</span></td> <td><span>总计</span></td>
<td ><span><if condition="$all_pay_amount neq ''">{$all_pay_amount}<else/>0</if></span></td> <td ><span><if condition="$all_pay_amount neq ''">{$all_pay_amount}<else/>0</if></span></td>
<td><if condition="$all_balance neq ''">{$all_balance}<else/>0</if></td> <td><if condition="$all_balance neq ''">{$all_balance}<else/>0</if></td>
<td></td>
<td><if condition="$all_total neq ''">{$all_total}<else/>0</if></td> <td><if condition="$all_total neq ''">{$all_total}<else/>0</if></td>
</tr> </tr>
</notemtpy> </notemtpy>

Loading…
Cancel
Save