diff --git a/Application/Admin/Controller/CompanyRelationController.class.php b/Application/Admin/Controller/CompanyRelationController.class.php index 84355f2e8..5971cea86 100644 --- a/Application/Admin/Controller/CompanyRelationController.class.php +++ b/Application/Admin/Controller/CompanyRelationController.class.php @@ -310,11 +310,40 @@ class CompanyRelationController extends AdminController } public function editRelation() { - + if ($_POST) { + $p= I('post.'); + if(!isset($p['id'])){ + $this->error('参数错误'); + } + //查询 + $y = $this->DBlogModel->where("id='{$p['id']}'")->find(); + $p['remark'] = $p['remark'] ?? ''; + if($y['settlement_type'] != $p['settlement_type'] || $y['invoice_type'] != $p['invoice_type'] || $y['invoice_content'] != $p['invoice_content'] || $y['is_payment'] != $p['is_payment'] || $y['collection'] != $p['collection']){ + $p['status'] = 0; + $p['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s")]); + } + $this->DBlogModel->save($p); + addOperationLog(['op_type'=>1,'key'=>$p['id'],'op_name'=>'修改','url'=>U('lists')]); + $this->ajaxReturn(["msg"=>"修改成功","code"=>1,"url"=>U("lists")]); + } else { + $params = I('get.'); + $id = $params['id'] ?? 0; + $id = intval($id); + $map['id'] = $id; + $dbres = $this->DBlogModel->where($map)->find(); + $this->assign('first_company_info',$this->getCompanyInfo($dbres['first_company_type'],$dbres['first_company_id'])); + $this->assign('second_company_info',$this->getCompanyInfo($dbres['second_company_type'],$dbres['second_company_id'])); + + $dbres['first_company_type'] =$this->CompanyType[$dbres['first_company_type']]; + $dbres['second_company_type'] =$this->CompanyType[$dbres['second_company_type']]; + + $this->assign('data', $dbres); + $this->display(); + } } public function delRelation() { - + } public function getCompanyList($type) { @@ -347,6 +376,32 @@ class CompanyRelationController extends AdminController } $this->success($companyInfo,'',true); } + public function getCompanyInfo($type,$id) + { + $companyInfo = []; + if($type == 0){ + //己方公司 + $companyInfo = M("CompanyInfo","tab_")->field("id,partner company_name,link_man,link_phone")->where("status='1' AND id='{$id}'")->find(); + } + if($type == 1){ + //上游 + $companyInfo = M("Partner","tab_")->field("id,partner company_name,company_type,link_man,link_phone")->where("status='1' AND id='{$id}'")->find(); + } + if($type == 2){ + //下游游 + $companyInfo = M("PromoteCompany","tab_")->field("id,company_belong,company_name,company_type,settlement_contact link_man,contact_phone link_phone")->where("status='1' AND id='{$id}'")->find(); + } + if(isset($companyInfo['company_belong'])){ + $companyInfo['company_belong'] = getCompanyBlong($companyInfo['company_belong']); + } + if(isset($companyInfo['company_type'])){ + $companyInfo['company_type'] = ($companyInfo['company_type'] == 1 ? "公司" :'个人'); + } + if(isset($companyInfo['link_phone']) && $companyInfo['link_phone']==0){ + $companyInfo['link_phone'] = ''; + } + return $companyInfo; + } public function menuAuth() { $addurl = U("addRelation"); diff --git a/Application/Admin/View/CompanyRelation/addRelation.html b/Application/Admin/View/CompanyRelation/addRelation.html index 378810312..a7ffd7ce6 100644 --- a/Application/Admin/View/CompanyRelation/addRelation.html +++ b/Application/Admin/View/CompanyRelation/addRelation.html @@ -205,10 +205,10 @@ 选择否将不能进行线上打款 diff --git a/Application/Admin/View/CompanyRelation/editRatio.html b/Application/Admin/View/CompanyRelation/editRatio.html deleted file mode 100644 index 3a208e093..000000000 --- a/Application/Admin/View/CompanyRelation/editRatio.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - - - - - - - - - - - - -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
推广公司: - {$data.company_name} - -
现包名: - {$data.relation_game_name} - -
原包名: - {$data.original_package_name} - -
*分成比例设定: - - - % - 当前需要修改成的分成比例 -
-
-
- - - -
- -
- - -
- - -
- -
- - % - -
-
-
-
- -
*生效期限: -
- - - - -
- 结束时间不填则默认永久。 -
备注: - - -
-
- - -
- - - 返回 - -
-
-
-
- - - -
- - - - if(C('COLOR_STYLE')=='blue_color') echo ''; - - - - - - - diff --git a/Application/Admin/View/CompanyRelation/editRelation.html b/Application/Admin/View/CompanyRelation/editRelation.html new file mode 100644 index 000000000..0c310e144 --- /dev/null +++ b/Application/Admin/View/CompanyRelation/editRelation.html @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + +
甲方公司类型: + {$data.first_company_type} +
甲方公司: + {$data.first_company_name} +
+
+ +
+ + + + + + + + + + + + + + + +
乙方公司类型: + {$data.second_company_type} +
乙方公司: + {$data.second_company_name} +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*结算周期: + + +
*开票类型: + + +
开票内容: + +
是否有打款流程: + + + + + 选择否将不能进行线上打款 +
*收款方: + + +
备注: + + +
+
+ +
+ + + 返回 + +
+
+
+
+
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + + diff --git a/Application/Admin/View/CompanyRelation/lists.html b/Application/Admin/View/CompanyRelation/lists.html index 8c8132aaf..e57980b5d 100644 --- a/Application/Admin/View/CompanyRelation/lists.html +++ b/Application/Admin/View/CompanyRelation/lists.html @@ -291,14 +291,14 @@ $(function(){ $("#company_type").change(); - $(".editRatio").on("click",function(){ + $(".editRelation").on("click",function(){ var id = $(this).data("id"); - var url = "{:U('editRatio')}"+"&id="+id; + var url = "{:U('editRelation')}"+"&id="+id; window.location.href = url; }) - $(".delRatio").on("click",function(){ + $(".delRelation").on("click",function(){ var id = $(this).data("id"); - var url = "{:U('delRatio')}"+"&id="+id; + var url = "{:U('delRelation')}"+"&id="+id; layer.confirm('删除后将无法恢复,请慎重选择', { closeBtn:0, title:false,