优化游戏模板显示

master
chenzhi 5 years ago
parent 4460f8e7cf
commit 8ded1f3169

@ -46,22 +46,9 @@ class GameRatioMouldController extends AdminController
foreach($dbres as $k=>&$v){ foreach($dbres as $k=>&$v){
$v['create_time'] = date("Y-m-d H:i:s",$v['create_time']); $v['create_time'] = date("Y-m-d H:i:s",$v['create_time']);
$v['company_belong'] ="下游".getCompanyBlong($v['company_belong']); $v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
$this->readTurnoverRatio($v);
$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;
} }
// dd($dbres);
//判断导出 //判断导出
if(isset($_REQUEST['export'])){ if(isset($_REQUEST['export'])){
$GetData = $_GET; $GetData = $_GET;
@ -232,7 +219,29 @@ class GameRatioMouldController extends AdminController
} }
} }
return $save['turnover_ratio']; 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: 0 3px;
margin-left:-7px margin-left:-7px
} }
tr{
border-bottom: 1px solid #e6e6e6;
}
</style> </style>
<div class="cf top_nav_list"> <div class="cf top_nav_list">
@ -98,14 +101,11 @@
<!-- 表头 --> <!-- 表头 -->
<thead> <thead>
<tr> <tr>
<!-- <th>
<input class="check-all" type="checkbox">
</th> -->
<th>游戏类型</th> <th>游戏类型</th>
<th>现包名</th> <th>现包名</th>
<th>原包名</th> <th>原包名</th>
<th>公司类型</th> <th>公司类型</th>
<th>比例分成</th> <th colspan="2">比例分成</th>
<th>时间</th> <th>时间</th>
<th>操作人</th> <th>操作人</th>
<th>操作</th> <th>操作</th>
@ -121,29 +121,34 @@
<else/> <else/>
<volist name="data" id="data"> <volist name="data" id="data">
<tr> <tr>
<!-- <td> <td rowspan="{$data.row}">{$data.game_type_name}</td>
<eq name="record.status" value="0"> <td rowspan="{$data.row}">{$data.relation_game_name}</td>
<input class="ids" type="checkbox" value="{$record['id']}" name="ids[]"> <td rowspan="{$data.row}">{$data.original_package_name}</td>
<else /> <td rowspan="{$data.row}">{$data.company_belong}</td>
<input class="ids disabled" disabled="disabled" type="checkbox" value="{$record['id']}" name="ids[]"> <notempty name="data['turnover_ratio'][0]">
</eq> <td>{$data['turnover_ratio'][0]['name']|default="--"}</td>
</td> --> <td>{$data['turnover_ratio'][0]['ratio']|showPercent}</td>
<td>{$data.game_type_name}</td> <else />
<td>{$data.relation_game_name}</td> <td>--</td>
<td>{$data.original_package_name}</td> <td>--</td>
<td>{$data.company_belong}</td> </notempty>
<td style="line-height: 16px;text-indent: 0;"> <td rowspan="{$data.row}">{$data.create_time}</td>
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;"> <td rowspan="{$data.row}">{$data.admin_name}</td>
{$data.turnover_ratio_str} <td rowspan="{$data.row}">
</div>
</td>
<td>{$data.create_time}</td>
<td>{$data.admin_name}</td>
<td>
<a href="{:U('edit', array('id'=>$data['id']))}" class="">修改</a> <a href="{:U('edit', array('id'=>$data['id']))}" class="">修改</a>
<a data-url="{:U('del', array('id'=>$data['id']))}" class="ratio_del">删除</a> <a data-url="{:U('del', array('id'=>$data['id']))}" class="ratio_del">删除</a>
</td> </td>
</tr> </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> </volist>
</if> </if>
</tbody> </tbody>

Loading…
Cancel
Save