From e684191b4536e74424d1824ebca0d89979403971 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sat, 23 May 2020 19:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A1=E6=A0=B8=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyRelationController.class.php | 103 +++++++++++++++++- .../Admin/View/CompanyRelation/lists.html | 101 ++++++++++++----- 2 files changed, 177 insertions(+), 27 deletions(-) diff --git a/Application/Admin/Controller/CompanyRelationController.class.php b/Application/Admin/Controller/CompanyRelationController.class.php index b0b97eb2a..5aa805cd2 100644 --- a/Application/Admin/Controller/CompanyRelationController.class.php +++ b/Application/Admin/Controller/CompanyRelationController.class.php @@ -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 = "
"; + } + + $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(){ diff --git a/Application/Admin/View/CompanyRelation/lists.html b/Application/Admin/View/CompanyRelation/lists.html index 53229954b..c3ad7dbfd 100644 --- a/Application/Admin/View/CompanyRelation/lists.html +++ b/Application/Admin/View/CompanyRelation/lists.html @@ -53,7 +53,7 @@ 生效列表 审核列表 -

推广游戏分成管理

+

公司绑定审核列表

-
-
-
    -
  1. -
    - 备注: - -
    -
    拒绝
    -
  2. -
-
-
+ @@ -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 = ''; + for (var i in company) { + if(company[i].id == company_id){ + companystr += "" + }else{ + companystr += "" + } + } + $("#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; + } })