From 25240227e4d836f999b15a896ea547c4cbe56381 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 9 Jan 2020 18:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/StatementController.class.php | 107 +-- .../Admin/View/Statement/editCpStatement.html | 799 ++++++++++++++++++ 2 files changed, 838 insertions(+), 68 deletions(-) create mode 100644 Application/Admin/View/Statement/editCpStatement.html diff --git a/Application/Admin/Controller/StatementController.class.php b/Application/Admin/Controller/StatementController.class.php index 5f30b96b2..d0730b443 100644 --- a/Application/Admin/Controller/StatementController.class.php +++ b/Application/Admin/Controller/StatementController.class.php @@ -12,7 +12,38 @@ class StatementController extends ThinkController $this->display(); } public function editCpStatement(){ - dd($_REQUEST['id']); + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $dbres = M("statement","tab_")->where("id = '{$id}'")->find(); + $first_party_info = json_decode($dbres['first_party_info'],true); + $second_party_info = json_decode($dbres['second_party_info'],true); + $statement_info = json_decode($dbres['statement_info'],true); + $fine = array_pop($statement_info); + $senddata = array( + "first_part_company"=>$first_party_info['partner'], + "second_part_company"=>$second_party_info['partner'], + "statement_type"=>$_REQUEST['pay_type'] == 0 ? 1 :0, + "first_party_info"=>$first_party_info, + "second_party_info"=>$second_party_info, + "statement_info"=>$statement_info, + "statement_count"=>array("sum_money"=>$dbres['statement_money'],"pay_amount"=>$dbres['pay_amount']), + "fine"=>$fine['sum_money'], + "statement_begin_time"=>date("Y-m-d",$dbres['statement_begin_time']), + "statement_end_time"=>date("Y-m-d",$dbres['statement_end_time']) + ); + $this->assign("data",$senddata); + if($_REQUEST['pay_type'] == 0){ + $this->assign("company",$dbres['company_name']); + }else{ + $this->assign("company",$first_party_info['partner']); + } + $this->assign("company_id",$dbres['company_id']); + $this->assign("company_name",$dbres['company_name']); + $this->assign("statement_begin_time",date("Y-m-d",$dbres['statement_begin_time'])); + $this->assign("statement_end_time",date("Y-m-d",$dbres['statement_end_time'])); + $this->assign("id",$dbres['id']); + $this->display(); + } //获取推广公司基础信息 public function getCpCompanyInfo() @@ -140,7 +171,7 @@ class StatementController extends ThinkController } //添加数据 - public function doAddCpStatement(){ + public function doAddCpStatement($id = 0){ $second_party_info = $_REQUEST['second_party_info']; $statement_info = $_REQUEST['statement_info']; $statement_info[] = array( @@ -165,8 +196,12 @@ class StatementController extends ThinkController "second_party_info"=>json_encode($_REQUEST['second_party_info'],JSON_UNESCAPED_UNICODE), "statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE) ); - $res = M("statement","tab_")->add($adddata); - if($res){ + if($id == 0){ + $res = M("statement","tab_")->add($adddata); + }else{ + $res = M("statement","tab_")->where("id = '{$id}'")->save($adddata); + } + if($res !== false){ $this->ajaxReturn(array("success"=>"ok","code"=>0)); }else{ $this->ajaxReturn(array("error"=>"database error","code"=>2000)); @@ -174,68 +209,4 @@ class StatementController extends ThinkController } - //测试数据 - public function testData() - { - $mycompany = array( - "id" => 0, - "partner" => "甲方海南万盟天下科技有限公司", - "link_man" => "雷丽华", - "link_phone" => "13067391751", - "address" => "福建省福州市鼓楼区福大怡山创业园区11号103", - "company_tax_no" => "1243245", - "payee_name" => "雷丽华", - "bank_account" => "1423134654531321564561636", - "opening_bank" => "福州市福大分行" - ); - $cpcompany = array( - "id" => 1, - "partner" => "乙方海南万盟天下科技有限公司", - "link_man" => "乙方雷丽华", - "link_phone" => "13067391752", - "address" => "福建省福州市鼓楼区福大怡山创业园区11号103", - "company_tax_no" => "1243245445646", - "payee_name" => "乙方王大锤", - "bank_account" => "2343254353462332423", - "opening_bank" => "福州市鼓楼区分行" - ); - $statement =array( - array( - "pay_amount"=>10000, - "game_id"=>77, - "game_name"=>"帝王的纷争(安卓版)", - "second_ratio"=>40, - "first_ratio"=>60, - "promote_ratio"=>1, - "fax_ratio"=>1, - "sum_money"=>5880.6, - "statement_begin_time"=>"2019-11-01", - "statement_end_time"=>"2019-11-30", - "statement_type"=>0 - ), - array( - "sum_money"=>2000, - "type_name"=>"罚款", - "statement_type"=>1 - ) - ); - $arr = array( - "statement_type"=>0, - "company_id"=>3, - "company_name"=>'福州品象网络科技有限公司', - "link_phone"=>'18959188422', - "statement_begin_time"=>'1572537600', - "statement_end_time"=>'1575129599', - 'create_time'=>'1578397556', - "statement_money"=>3880.6, - "is_confirm"=>0, - "pay_type"=>0, - "first_party_info"=>json_encode($mycompany,JSON_UNESCAPED_UNICODE), - "second_party_info"=>json_encode($cpcompany,JSON_UNESCAPED_UNICODE), - "statement_info"=>json_encode($statement,JSON_UNESCAPED_UNICODE) - ); - $res = M("statement","tab_")->add($arr); - dd($res); - } - } diff --git a/Application/Admin/View/Statement/editCpStatement.html b/Application/Admin/View/Statement/editCpStatement.html new file mode 100644 index 000000000..7e26ef44c --- /dev/null +++ b/Application/Admin/View/Statement/editCpStatement.html @@ -0,0 +1,799 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
甲方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
乙方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+
+
+

支付给:{$company} + +

+
+ +
+
+
+

结算订单的月份:

+
+
+ +  -  +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
结算时间产品平台总额分成比例渠道费率税费费率结算金额
甲方乙方 + 结算金额=平台总额*(1-渠道费)*分成比例*(1-税费费率)
+ 请先选择生成条件后点击生成对账数据 +
+
+
+
+
+ + + + + + + + + + + + + + + +
收款方名称: + +
银行账号: + +
开户行: + +
+
+
+ + + + + + + + + + + + + + + +
付款方名称: + +
银行账号: + +
开户行: + +
+
+
+
+ +
+ + + + + + + + + \ No newline at end of file