优化审核列表

master
chenzhi 5 years ago
parent 5ce3676e02
commit e684191b45

@ -20,6 +20,23 @@ class CompanyRelationController extends AdminController
"1"=>"上游cp公司",
"2"=>"联运下游渠道公司"
];
public $SettlementType=[
"0"=>"无",
"1"=>"周结",
"2"=>"月结"
];
public $InvoiceType=[
"1"=>"专票",
"2"=>"普票"
];
public $IsPayment=[
"1"=>"是",
"2"=>"否"
];
public $Collection=[
"1"=>"甲方",
"2"=>"乙方"
];
public function _initialize()
{
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
@ -35,8 +52,90 @@ class CompanyRelationController extends AdminController
//审核列表
public function lists()
{
$this->display();
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
//权限分配
if(!IS_ROOT){
$this->OpAuthList= getModuleControllerAuth();
}
$where['_string'] = '1 = 1';
if(isset($params['company_type'])){
$where['_string'] .= " AND (first_company_type='{$params['company_type']}' OR second_company_type='{$params['company_type']}')";
}
if(isset($params['company_id'])){
$where['_string'] .= " AND (first_company_id='{$params['company_id']}' OR second_company_id='{$params['company_id']}')";
}
if(isset($params['settlement_type'])){
$where['settlement_type'] = $params['settlement_type'];
}
if(isset($params['invoice_type'])){
$where['invoice_type'] = $params['invoice_type'];
}
if(isset($params['is_payment'])){
$where['is_payment'] = $params['is_payment'];
}
if(isset($params['status'])){
$where['status'] = $params['status'];
}
$dbres = $this->DBlogModel->where($where);
if(isset($params['export'])){
$dbres = $dbres->select();
}else{
$dbres = $dbres->page($page, $row)->select();
}
foreach($dbres as $k=>&$v){
$v['settlement_type'] =$this->SettlementType[$v['settlement_type']];
$v['first_company_type'] =$this->CompanyType[$v['first_company_type']];
$v['second_company_type'] =$this->CompanyType[$v['second_company_type']];
$v['invoice_type'] =$this->InvoiceType[$v['invoice_type']];
$v['is_payment'] =$this->IsPayment[$v['is_payment']];
$v['collection'] =$this->Collection[$v['collection']];
$v['verify_log'] = json_decode($v['verify_log'], true);
if (isset($params['export'])) {
$symbol = "\n";
} else {
$symbol = "<br>";
}
$v["create"]= "{$v['verify_log']['create_user']} {$symbol} {$v['verify_log']['create_time']}";
if(isset($v['verify_log']['market_user'])){
if($v['status'] == -1){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
}
$v["market"]= "{$ts}({$v['verify_log']['market_user']}) {$symbol} {$v['verify_log']['market_time']}";
}else{
$v["market"] = '--';
}
if(isset($v['verify_log']['admin_user'])){
if($v['status'] == -2){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
}
$v["admin"]= "{$ts}({$v['verify_log']['admin_user']}) {$symbol} {$v['verify_log']['admin_time']}";
}else{
$v["admin"] = '--';
}
$v['oplist'] = $this->OpAuth($v);
}
$count = $this->DBlogModel->field("count(id) count")->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
$this->assign('Status',$this->Status);
$this->assign('SettlementType',$this->SettlementType);
$this->assign('CompanyType',$this->CompanyType);
$this->assign('InvoiceType',$this->InvoiceType);
$this->assign('IsPayment',$this->IsPayment);
$this->assign('menubtn',$this->menuAuth());
$this->display();
}
public function marketAgree(){

@ -53,7 +53,7 @@
<a href="{:U('index')}">生效列表</a>
<a class="tabchose" href="{:U('list')}">审核列表</a>
</div>
<h3 class="page_title">推广游戏分成管理</h3>
<h3 class="page_title">公司绑定审核列表</h3>
<p class="description_text"></p>
</div>
<!-- <div class="fl button_list">
@ -67,19 +67,41 @@
<label>搜索:</label>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="company_type" name="company_type" class="select_gallery" >
<option value="">请选择公司类型</option>
<volist name="CompanyType" id="vo">
<option value="{$key}" <if condition="isset($_GET['company_type']) && $key eq I('company_type')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option value="">请选择公司</option>
<volist name="companyList" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq I('company_id')">selected</if> >{$vo.company_name}</option>
<option value="">请先选择公司类型</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="settlement_type" name="settlement_type" class="select_gallery" >
<option value="">请选择结算周期</option>
<volist name="SettlementType" id="vo">
<option value="{$key}" <if condition="isset($_GET['settlement_type']) && $key eq I('settlement_type')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" >
<option value="">请选择开票类型</option>
<volist name="InvoiceType" id="vo">
<option value="{$key}" <if condition="isset($_GET['invoice_type']) && $key eq I('invoice_type')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="relation_game_id" name="relation_game_id" class="select_gallery" >
<option value="">现包名</option>
<volist name="gameList" id="vo">
<option value="{$vo.relation_game_id}" <if condition="$vo.relation_game_id eq I('relation_game_id')">selected</if> >{$vo.relation_game_name}</option>
<select id="is_payment" name="is_payment" class="select_gallery" >
<option value="">请选择是否有打款</option>
<volist name="IsPayment" id="vo">
<option value="{$key}" <if condition="isset($_GET['is_payment']) && $key eq I('is_payment')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
@ -87,14 +109,14 @@
<div class="input-list input-list-game search_label_rehab">
<select id="status" name="status" class="select_gallery" >
<option value="">请选择审核状态</option>
<volist name="status" id="vo">
<volist name="Status" id="vo">
<option value="{$key}" <if condition="isset($_GET['status']) && $key eq I('status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('index','&row='.I('row'),false)}">搜索</a>
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','&row='.I('row'),false)}">搜索</a>
</div>
</div>
@ -217,20 +239,7 @@
</if>
{$_page|default=''}
</div>
<!--弹出层-->
<div class="promote-layer mb20">
<form id="ajaxForm" action="{:U('set_withdraw')}" method="post">
<ol class="promote-con">
<li class="promote-con-con " id="deny">
<div class="mb20">
<span class="promote-name">备注:</span>
<textarea class="textarea-style" name="remark" id="remark"></textarea>
</div>
<a class="ajax-post pack" style="cursor: pointer;" target-form="ids" url="{:U('setStatus',array('status'=>-1))}"><div class="promote-btn">拒绝</div></a>
</li>
</ol>
</form>
</div>
</block>
<block name="script">
@ -264,6 +273,29 @@ $(function(){
$("#search").click();
}
});
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){
var type = $(this).find("option:selected").val();
var typename=setTypeName(type);
var url = "{:U('getCompanyList')}"+"&type="+type;
$.get(url,function(data){
var company = data.info;
var companystr = '<option value="">'+typename+'</option>';
for (var i in company) {
if(company[i].id == company_id){
companystr += "<option value='" + company[i].id + "' selected='selected'>" + company[i].company_name + "</option>"
}else{
companystr += "<option value='" + company[i].id + "'>" + company[i].company_name + "</option>"
}
}
$("#company_id").html(companystr);
$("#company_id").select2();
})
})
$("#company_type").change();
$(".editRatio").on("click",function(){
var id = $(this).data("id");
var url = "{:U('editRatio')}"+"&id="+id;
@ -355,7 +387,26 @@ $(function(){
});
}
})
function setTypeName(type) {
var typename = '';
switch (type) {
case '':
typename ="请先选择公司类型";
break;
case '0':
typename = "请选择已方公司";
break;
case "1":
typename = "请选择上游CP公司";
break;
case "2":
typename ="请选择联运下游渠道公司";;
break;
default:
break;
}
return typename;
}
})

Loading…
Cancel
Save