新增结算周期读取

master
chenzhi 4 years ago
parent 553d9b0f91
commit d5aeb21b33

@ -44,9 +44,10 @@ class CompanyGameRatioController extends AdminController
$gameres = M("game","tab_")->field("tab_game.relation_game_id,tab_game.relation_game_name,IF(tab_game.original_package_name='','未配置',tab_game.original_package_name) original_package_name,tab_game_type.type_name game_type_name")->where($gamewhere)->join("tab_game_type on tab_game.game_type_id = tab_game_type.id")->group("tab_game.relation_game_id")->select(false);
$dbres = M("company_game_ratio","tab_")
->alias('m')
->field("m.*,g.*,p.company_name,p.company_belong")
->field("m.*,g.*,p.company_name,p.company_belong,IFNULL(r.settlement_type,0) settlement_type")
->join("left JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("left JOIN tab_promote_company p ON m.company_id = p.id")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where);
if(isset($params['export'])){
$dbres = $dbres->select();
@ -54,7 +55,6 @@ class CompanyGameRatioController extends AdminController
$dbres = $dbres->page($page, $row)->select();
}
foreach($dbres as $k=>&$v){
$v['settlement_type'] ='--';
$v['begin_time'] = date("Y-m-d",$v['begin_time']);
$v['end_time'] = $v['end_time'] ? date('Y-m-d', $v['end_time']) : '永久';
@ -66,6 +66,11 @@ class CompanyGameRatioController extends AdminController
} else {
$symbol = "<br>";
}
if($v['settlement_type'] == 0){
$v['settlement_type'] = '--';
}else{
$v['settlement_type'] = $v['settlement_type']== 1 ? "周结" : '月结';
}
//新
$thisTurnoverRatios = $v['turnover_ratio'] ? json_decode($v['turnover_ratio'], true) : [];
$thisRatioDtl = "默认:{$v['ratio']}%";
@ -136,9 +141,10 @@ class CompanyGameRatioController extends AdminController
$gameres = M("game","tab_")->field("tab_game.relation_game_id,tab_game.relation_game_name,IF(tab_game.original_package_name='','未配置',tab_game.original_package_name) original_package_name,tab_game_type.type_name game_type_name")->where($gamewhere)->join("tab_game_type on tab_game.game_type_id = tab_game_type.id")->group("tab_game.relation_game_id")->select(false);
$dbres = M("company_game_ratio_log","tab_")
->alias('m')
->field("m.*,g.*,p.company_name,p.company_belong")
->field("m.*,g.*,p.company_name,p.company_belong,IFNULL(r.settlement_type,0) settlement_type")
->join("left JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("left JOIN tab_promote_company p ON m.company_id = p.id")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where)
->order("FIELD(m.status,0,1,-1,-2,2),id desc");
if(isset($params['export'])){
@ -147,7 +153,11 @@ class CompanyGameRatioController extends AdminController
$dbres = $dbres->page($page, $row)->select();
}
foreach($dbres as $k=>&$v){
$v['settlement_type'] ='--';
if($v['settlement_type'] == 0){
$v['settlement_type'] = '--';
}else{
$v['settlement_type'] = $v['settlement_type']== 1 ? "周结" : '月结';
}
$v['begin_time'] = date("Y-m-d",$v['begin_time']);
$v['end_time'] = $v['end_time'] ? date('Y-m-d', $v['end_time']) : '永久';

@ -108,9 +108,6 @@
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>公司名称</th>
<th>内外团</th>
<th>结算周期</th>
@ -127,14 +124,11 @@
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="9" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<volist name="data" id="data">
<tr>
<td>
<input class="ids" type="checkbox" data-status="{$data.status}" value="{$data['id']}" name="ids[]" >
</td>
<td>{$data.company_name}</td>
<td>{$data.company_belong}</td>
<td>{$data.settlement_type}</td>

Loading…
Cancel
Save