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

master
liuweiwen 5 years ago
commit 466153f51a

@ -1407,7 +1407,7 @@ class StatController extends ThinkController
$model = M('device_statistics','tab_');
if ($type == 0) {
$return = $model->where(['time'=>['neq',0]])->sum('new_device');
$return = $model->where(array('time'=>array('neq',0)))->sum('new_device');
// $return = $device->all_device();
} else if($type == 1) {
$return = $model->where(['time'=>array('between',[$todaystart,$todaystart+86399])])->sum('new_device');

@ -2501,7 +2501,15 @@ class DownloadController extends BaseController {
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
->where($map)
->order('id desc')
->select();
->select();
$total = [];
$total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
->where($map)
->find();
$total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount'];
$total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount'];
$total['income'] = empty($total['income']) ? 0 : $total['income'];
$total['income'] = bcdiv($total['income'], 100, 2);
//提现状态
$withdrawIds = [];
foreach ($data as $key => $value) {
@ -2548,6 +2556,19 @@ class DownloadController extends BaseController {
}
}
$allData['pay_order_number'] = '合计';
$allData['game_name'] = '--';
$allData['user_account'] = '--';
$allData['promote_account'] = '--';
$allData['pay_amount'] = $total['pay_amount'];
$allData['pay_amount_zhi'] = $total['direct_pay_amount'];
$allData['pay_amount_nei'] = $total['inner_pay_amount'];
$allData['selle_ratio'] = '--';
$allData['selle_ratio'] = '--';
$allData['income'] = $total['income'];
$allData['pay_time'] = '--';
$allData['selle_status'] = '--';
$data[] = $allData;
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
@ -2895,6 +2916,12 @@ class DownloadController extends BaseController {
$roles = M()->alias('record')
->table($subQuery)
->select();
$total = [];
$total = M('user_play_data_count', 'tab_')->alias('uc')
->field($fieldUC)
->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->where($map)
->find();
foreach ($roles as $role) {
$records[] = [
'user_account' => encryption($role['user_account']),
@ -2915,7 +2942,22 @@ class DownloadController extends BaseController {
'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600))
];
}
$allData['user_account'] = '合计';
$allData['game_name'] = '--';
$allData['role_name'] = '--';
$allData['role_id'] = '--';
$allData['role_level'] = '--';
$allData['server_id'] = '--';
$allData['server_name'] = '--';
$allData['recharge_cost'] = $total['recharge_cost'];
$allData['recharge_count'] = $total['recharge_count'];
$allData['recharge_cost_today'] = $total['recharge_cost_today'];
$allData['play_time'] = '--';
$allData['play_ip'] = '--';
$allData['promote_id'] = '--';
$allData['promote_account'] = '--';
$allData['sdk_version'] = '--';
$allData['unlogin_day'] = '--';
$xlsData = [];
foreach ($records as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']);
@ -2927,6 +2969,7 @@ class DownloadController extends BaseController {
}
$xlsData[] = $value1;
}
$xlsData[] = $allData;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
}
@ -3027,6 +3070,28 @@ class DownloadController extends BaseController {
ob_flush();
flush();
}
$income = '0.00';
$income = M('Spend', 'tab_')
->field('sum(tab_spend.pay_amount) as income')
->join('tab_game on tab_spend.game_id = tab_game.id')
->join('left join tab_promote on tab_spend.promote_id = tab_promote.id')
->where($map)
->order('tab_spend.id desc')
->find()['income'];
$csvData1["user_account"] = "合计";
$csvData1["order_number"] = "--";
$csvData1["pay_amount"] = $income;
$csvData1["pay_way"] = "--";
$csvData1["game_name"] = "--";
$csvData1["server_name"] = "--";
$csvData1["game_player_name"] = "--";
$csvData1["p_p_proinfo"] = "--";
$csvData1["p_proinfo"] = "--";
$csvData1["proinfo"] = "--";
$csvData1["pay_time"] = "--";
mb_convert_variables('GBK', 'UTF-8', $csvData1);
fputcsv($fp, $csvData1);
$xlsData[] = $csvData1;
fclose($fp);
$this->backSuccessExport($id);
}

@ -223,9 +223,12 @@ class FinanceController extends BaseController
->page($page, $row)
->select();
$count = $model->where($map)->count();
$total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
$total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
->where($map)
->find();
$total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount'];
$total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount'];
$total['income'] = empty($total['income']) ? 0 : $total['income'];
$total['income'] = bcdiv($total['income'], 100, 2);
//提现状态

@ -164,11 +164,11 @@
<td>{$vo.promote_account}</td>
<td>{$vo.pay_amount}</td>
<if condition="$vo.pay_way eq -1">
<td>0</td>
<td>0.00</td>
<td>{$vo.pay_amount}</td>
<else/>
<td>{$vo.pay_amount}</td>
<td>0</td>
<td>0.00</td>
</if>
<td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
@ -182,13 +182,8 @@
<td>--</td>
<td>--</td>
<td>{$total.pay_amount}</td>
<if condition="$total.pay_way eq -1">
<td>0.00</td>
<td>{$total.pay_amount}</td>
<else/>
<td>{$total.pay_amount}</td>
<td>0.00</td>
</if>
<td>{$total.direct_pay_amount}</td>
<td>{$total.inner_pay_amount}</td>
<td>--</td>
<td>{$total.income}</td>
<td>--</td>

@ -196,9 +196,9 @@
<td>{$vo.game_name}</td>
<td>{$vo.server_name}</td>
<td>{$vo.game_player_name}</td>
<td>{$vo.p_p_pro_account}({$vo.p_p_pro_real_name})</td>
<td>{$vo.p_pro_account}({$vo.p_pro_real_name})</td>
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
<td>{$vo.p_p_pro_account}({$vo.p_p_pro_real_name})</td>
<td>{$vo.p_pro_account}({$vo.p_pro_real_name})</td>
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
<td>{$vo.pay_time|date='Y-m-d H:i:s',###}</td>
<!-- <td>-->
<!-- <a href="{:U('Query/viewSpendDetailed',array('id'=>$vo['id']))}" style="cursor: pointer"-->

Loading…
Cancel
Save