推广平台->数据管理-订单查询|数据管理-充值统计|财务管理-结算明细--新增合计

master
chenxiaojun 5 years ago
parent acf2ff1310
commit d07f617775

@ -182,6 +182,7 @@ class FinanceController extends BaseController
$parameter['endtime'] = $initEndTime;
$data = [];
$total = [];
$count = 0;
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$withdrawIds = [];
@ -222,6 +223,10 @@ 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')
->where($map)
->find();
$total['income'] = bcdiv($total['income'], 100, 2);
//提现状态
if (empty($withdrawIds)) {
@ -264,6 +269,7 @@ class FinanceController extends BaseController
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('total', $total);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);

@ -91,6 +91,7 @@ class QueryController extends BaseController
$data = [];
$count = 0;
$income = '0.00';
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$data = M('Spend', 'tab_')
->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain')
@ -105,6 +106,14 @@ class QueryController extends BaseController
->join('tab_game on tab_spend.game_id = tab_game.id')
->where($map)
->count();
$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'];
}
if (!empty($data)) {
foreach ($data as &$list) {
@ -177,6 +186,7 @@ class QueryController extends BaseController
}
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('income', $income);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('setdate', date("Y-m-d"));
@ -1736,6 +1746,7 @@ class QueryController extends BaseController
$records = [];
$pagination = '';
$count = 0;
$total = [];
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
@ -1824,6 +1835,11 @@ class QueryController extends BaseController
$query = M()->alias('record')
->table($subQuery)
->order($orderBy);
$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();
list($records, $pagination, $count) = $this->paginate($query);
@ -1839,6 +1855,7 @@ class QueryController extends BaseController
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('count', $count);
$this->assign('total', $total);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('sort', $sort);

@ -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>
@ -176,6 +176,24 @@
<td>{$vo.selle_status}</td>
</tr>
</volist>
<tr class="num2">
<td>合计}</td>
<td>--</td>
<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>--</td>
<td>{$total.income}</td>
<td>--</td>
<td>--</td>
</tr>
</empty>
</table>
</div>

@ -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"-->
@ -206,6 +206,19 @@
<!-- </td>-->
</tr>
</volist>
<tr>
<td>合计</td>
<td>--</td>
<td>--</td>
<td>{$income}</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
</empty>
</table>
</div>

@ -167,6 +167,20 @@
<td>{$record.promote_account}</td>
</tr>
</volist>
<tr>
<td>合计</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>{$total.recharge_cost}</td>
<td>{$total.recharge_count}</td>
<td>{$total.recharge_cost_today}</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
</empty>
</table>

Loading…
Cancel
Save