master
yulingwei 5 years ago
commit 0652c31664

@ -870,20 +870,18 @@ class GameController extends ThinkController
$map['pdw.partner_id'] = $partner['partner_id']; $map['pdw.partner_id'] = $partner['partner_id'];
} }
$list = M('partner_divide_warn', 'tab_') $list = M('partner_divide_warn', 'tab_')
->alias('pdw')->field("pdw.*, p.partner, sum(s.pay_amount) as total_amount, group_concat(distinct(g.relation_game_name)) as game_name") ->alias('pdw')->field("pdw.*, p.partner, group_concat(distinct(g.relation_game_name)) as game_name, group_concat(distinct(g.id)) as game_id")
->join("tab_partner p on p.id = pdw.partner_id") ->join("tab_partner p on p.id = pdw.partner_id")
->join("tab_game g on pdw.partner_id = g.partner_id", 'left') ->join("tab_game g on pdw.partner_id = g.partner_id", 'left')
->join('tab_spend s on s.game_id = g.id and s.pay_status = 1', 'left') ->where(array_merge($map))
->where($map)
->group('pdw.id, p.partner') ->group('pdw.id, p.partner')
->page($p, $row)->select(); ->page($p, $row)->select();
$count = M('partner_divide_warn', 'tab_')->alias('pdw')->join("tab_game g on pdw.partner_id = g.partner_id", 'left')->where($map)->count(); $count = M('partner_divide_warn', 'tab_')->alias('pdw')->join("tab_game g on pdw.partner_id = g.partner_id", 'left')->where($map)->count();
// if (!empty($list)) { if (!empty($list)) {
// foreach ($list as &$item) { foreach ($list as &$item) {
// $item['create_time'] = date('Y-m-d', $item['create_time']); $item['total_amount'] = M('spend', 'tab_')->where(['pay_status'=>1, 'game_id'=>['in',explode(',', $item['game_id'])]])->sum('pay_amount');
// $item['upt_time'] = date('Y-m-d', $item['upt_time']); }
// } }
// }
$page = set_pagination($count, $row); $page = set_pagination($count, $row);
if ($page) { if ($page) {
$this->assign('_page', $page); $this->assign('_page', $page);

@ -32,6 +32,7 @@
.data_game_list table td{ .data_game_list table td{
line-height:1; line-height:1;
padding: 3px; padding: 3px;
height: 30px;
} }
</style> </style>
@ -167,7 +168,7 @@
<?php if ($k == 0) :?> <?php if ($k == 0) :?>
<tr> <tr>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td> <td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>123</td> <td>{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['relation_game_name']}</td> <td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td> <td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td> <td>{$channel['game_ratio']}%</td>
@ -181,7 +182,7 @@
</tr> </tr>
<?php else :?> <?php else :?>
<tr> <tr>
<td>123</td> <td>{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['relation_game_name']}</td> <td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td> <td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td> <td>{$channel['game_ratio']}%</td>

@ -32,6 +32,7 @@
.data_game_list table td{ .data_game_list table td{
line-height:1; line-height:1;
padding: 3px; padding: 3px;
height: 30px;
} }
</style> </style>
@ -119,7 +120,7 @@
<?php if ($k == 0) :?> <?php if ($k == 0) :?>
<tr> <tr>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td> <td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>123</td> <td>{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['relation_game_name']}</td> <td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td> <td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td> <td>{$channel['game_ratio']}%</td>
@ -133,7 +134,7 @@
</tr> </tr>
<?php else :?> <?php else :?>
<tr> <tr>
<td>123</td> <td>{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['relation_game_name']}</td> <td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td> <td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td> <td>{$channel['game_ratio']}%</td>

Loading…
Cancel
Save