隐藏我方分成比例

master
liuweiwen 5 years ago
parent a114c7e659
commit 70c71abac1

@ -98,9 +98,10 @@ class PartnerController extends ThinkController
->select(); ->select();
// dd($cp_game_ratio_map); // dd($cp_game_ratio_map);
$parseGameRadiores = array(); $parseGameRadiores = array();//合作方分成比例
foreach ($gameradiores as $key =>$val) { foreach ($gameradiores as $key =>$val) {
$val['row'] = 1; $val['row'] = 1;
$val['my_ratio'] = 100 - $val['ratio'];
if ($val['begin_total_amount'] == 0) { if ($val['begin_total_amount'] == 0) {
$val['name'] = '默认比例'; $val['name'] = '默认比例';
if (isset($parseGameRadiores[$val['game_id']])) { if (isset($parseGameRadiores[$val['game_id']])) {
@ -115,11 +116,18 @@ class PartnerController extends ThinkController
} }
$parseGameRadiores[$val['game_id']][] = $val; $parseGameRadiores[$val['game_id']][] = $val;
} }
// dd($parseGameRadiores); $myGameRadiores = $parseGameRadiores;//我方分成比例
foreach ($myGameRadiores as $key => &$val) {
foreach ($val as $k => &$v) {
$v['ratio'] = 100 - $v['ratio'];
}
}
$parseGames = array(); $parseGames = array();
foreach ($games as $key =>$val) { foreach ($games as $key =>$val) {
$val['game_ratio'] = $parseGameRadiores[$val['id']]; $val['game_ratio'] = $parseGameRadiores[$val['id']];
$val['my_game_ratio'] = $myGameRadiores[$val['id']];
if(array_key_exists($val['id'],$parseGameRadiores)){//游戏有比例 if(array_key_exists($val['id'],$parseGameRadiores)){//游戏有比例
$row2 = array_sum(array_column($val['game_ratio'], 'row')) ; $row2 = array_sum(array_column($val['game_ratio'], 'row')) ;
$val['row'] = empty($row2) ? 1: $row2; $val['row'] = empty($row2) ? 1: $row2;

@ -106,6 +106,7 @@
<th>原包名</th> <th>原包名</th>
<th>现包名</th> <th>现包名</th>
<th colspan="2">合作方分成比例</th> <th colspan="2">合作方分成比例</th>
<!-- <th colspan="2">我方分成比例</th>-->
</tr> </tr>
</thead> </thead>
@ -148,17 +149,25 @@
<tr> <tr>
<td>{$ratio['name']}</td> <td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td> <td>{$ratio['ratio']}</td>
<!-- <td>{$ratio['name']}</td>-->
<!-- <td>{$ratio['my_ratio']}</td>-->
</tr> </tr>
<else /> <else />
<td>{$ratio['name']}</td> <td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td> <td>{$ratio['ratio']}</td>
<!-- <td>{$ratio['name']}</td>-->
<!-- <td>{$ratio['my_ratio']}</td>-->
</if> </if>
</foreach> </foreach>
<else /> <else />
<td >-</td> <td >-</td>
<td>-</td> <td>-</td>
<!-- <td>-</td>-->
<!-- <td>-</td>-->
</notempty> </notempty>
</tr> </tr>
<else /> <else />
<td rowspan="{$game.row}">{$game['game_type_name']}</td> <td rowspan="{$game.row}">{$game['game_type_name']}</td>
@ -171,18 +180,25 @@
<tr> <tr>
<td>{$ratio['name']}</td> <td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td> <td>{$ratio['ratio']}</td>
<!-- <td>{$ratio['name']}</td>-->
<!-- <td>{$ratio['my_ratio']}</td>-->
</tr> </tr>
<else /> <else />
<td>{$ratio['name']}</td> <td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td> <td>{$ratio['ratio']}</td>
<!-- <td>{$ratio['name']}</td>-->
<!-- <td>{$ratio['my_ratio']}</td>-->
</if> </if>
</foreach> </foreach>
<else /> <else />
<td >-</td> <td >-</td>
<td>-</td> <td>-</td>
<!-- <td>-</td>-->
<!-- <td>-</td>-->
</notempty> </notempty>
</if> </if>
</foreach> </foreach>
<else /> <else />
@ -191,6 +207,8 @@
<td rowspan="{$data.row}">-</td> <td rowspan="{$data.row}">-</td>
<td rowspan="{$data.row}">-</td> <td rowspan="{$data.row}">-</td>
<td rowspan="{$data.row}">-</td> <td rowspan="{$data.row}">-</td>
<!-- <td rowspan="{$data.row}">-</td>-->
<!-- <td rowspan="{$data.row}">-</td>-->
</notempty> </notempty>
</tr> </tr>

Loading…
Cancel
Save