优化游戏模板显示

master
chenzhi 5 years ago
parent 4460f8e7cf
commit 8ded1f3169

@ -46,22 +46,9 @@ class GameRatioMouldController extends AdminController
foreach($dbres as $k=>&$v){
$v['create_time'] = date("Y-m-d H:i:s",$v['create_time']);
$v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
$thisTurnoverRatios = $v['turnover_ratio'] ? json_decode($v['turnover_ratio'], true) : [];
$thisRatioDtl = "默认:{$v['ratio']}%";
if ($thisTurnoverRatios) {
if (I('export', 0) == 1) {
$symbol = "\n";
} else {
$symbol = "<br>";
}
foreach ($thisTurnoverRatios as $thisTurnoverRatio) {
$thisIntervalClosedStatusText = isset($thisTurnoverRatio['instanceof']) ? ($thisTurnoverRatio['instanceof'] == 1 ? '≥' : '>') : '≥';
$thisRatioDtl .= "{$symbol}月流水{$thisIntervalClosedStatusText}{$thisTurnoverRatio['turnover']},比例:{$thisTurnoverRatio['ratio']}%";
}
}
$v['turnover_ratio_str'] = $thisRatioDtl;
$this->readTurnoverRatio($v);
}
// dd($dbres);
//判断导出
if(isset($_REQUEST['export'])){
$GetData = $_GET;
@ -232,7 +219,29 @@ class GameRatioMouldController extends AdminController
}
}
return $save['turnover_ratio'];
}
//设置比例阶梯
protected function readTurnoverRatio(&$v){
$turnover_ratio = json_decode($v['turnover_ratio'],true);
$v['turnover_ratio'] = array(
array("ratio"=>$v['ratio']."%","name"=>"默认比例")
);
foreach($turnover_ratio as $ke=>$va){
$t=array("ratio"=>$va["ratio"]."%");
if(array_key_exists("instanceof",$va)){
//存在
if($va['instanceof']=='1'){
$t['name']="月流水≥".$va['turnover'];
}else{
$t['name']="月流水>".$va['turnover'];
}
}else{
$t['name']="月流水≥".$va['turnover'];
}
$v['turnover_ratio'][]=$t;
}
$v['row'] = count($v['turnover_ratio']);
}

@ -42,6 +42,9 @@
margin: 0 3px;
margin-left:-7px
}
tr{
border-bottom: 1px solid #e6e6e6;
}
</style>
<div class="cf top_nav_list">
@ -98,14 +101,11 @@
<!-- 表头 -->
<thead>
<tr>
<!-- <th>
<input class="check-all" type="checkbox">
</th> -->
<th>游戏类型</th>
<th>现包名</th>
<th>原包名</th>
<th>公司类型</th>
<th>比例分成</th>
<th colspan="2">比例分成</th>
<th>时间</th>
<th>操作人</th>
<th>操作</th>
@ -121,29 +121,34 @@
<else/>
<volist name="data" id="data">
<tr>
<!-- <td>
<eq name="record.status" value="0">
<input class="ids" type="checkbox" value="{$record['id']}" name="ids[]">
<else />
<input class="ids disabled" disabled="disabled" type="checkbox" value="{$record['id']}" name="ids[]">
</eq>
</td> -->
<td>{$data.game_type_name}</td>
<td>{$data.relation_game_name}</td>
<td>{$data.original_package_name}</td>
<td>{$data.company_belong}</td>
<td style="line-height: 16px;text-indent: 0;">
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;">
{$data.turnover_ratio_str}
</div>
</td>
<td>{$data.create_time}</td>
<td>{$data.admin_name}</td>
<td>
<td rowspan="{$data.row}">{$data.game_type_name}</td>
<td rowspan="{$data.row}">{$data.relation_game_name}</td>
<td rowspan="{$data.row}">{$data.original_package_name}</td>
<td rowspan="{$data.row}">{$data.company_belong}</td>
<notempty name="data['turnover_ratio'][0]">
<td>{$data['turnover_ratio'][0]['name']|default="--"}</td>
<td>{$data['turnover_ratio'][0]['ratio']|showPercent}</td>
<else />
<td>--</td>
<td>--</td>
</notempty>
<td rowspan="{$data.row}">{$data.create_time}</td>
<td rowspan="{$data.row}">{$data.admin_name}</td>
<td rowspan="{$data.row}">
<a href="{:U('edit', array('id'=>$data['id']))}" class="">修改</a>
<a data-url="{:U('del', array('id'=>$data['id']))}" class="ratio_del">删除</a>
</td>
</tr>
<if condition="$data['row'] gt 1">
<foreach name="data['turnover_ratio']" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game_ratio['name']|default="--"}</td>
<td>{$game_ratio['ratio']|showPercent}</td>
</tr>
</if>
</foreach>
</if>
</volist>
</if>
</tbody>

Loading…
Cancel
Save