From 89801c1467b3f372e5af030b131471bab8c9829a Mon Sep 17 00:00:00 2001 From: zyx Date: Sun, 23 Aug 2020 13:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementController.class.php | 44 ++++++++++++++----- .../viewSpecialComplement.html | 8 +++- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 18ad9a9fe..317ef6618 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -1096,9 +1096,9 @@ class CompanyStatementController extends ThinkController public function addSpecialComplementPost( ) { $data = json_decode($_REQUEST['data'],true); - +// dump($data);die(); $withdraw_type = 3; - + M()->startTrans(); foreach ($data as $key => $value) { $company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find(); @@ -1106,13 +1106,15 @@ class CompanyStatementController extends ThinkController $company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find(); $insert['is_payment'] = $company_type['is_payment']; - $insert['statement_begin_time'] = $value['statement_begin_time']; - $insert['statement_end_time'] = $value['statement_end_time']; + $insert['statement_begin_time'] = strtotime($value['statement_begin_time']); + $insert['statement_end_time'] = strtotime($value['statement_end_time']); $insert['withdraw_type'] = $withdraw_type; $insert['company_belong'] = $company_data['company_belong']; $insert['company_name'] = $company_data['company_name']; $insert['company_id'] = $value['company_id']; - $insert['company_type'] = $value['company_type']; + $insert['company_type'] = $company_data['company_type']; + $insert['pay_type'] = $company_type['collection']; + $insert['verify_log'] = ''; $proCompany_info['id'] = $company_data['id']; $proCompany_info['partner'] =$company_data['company_name']; @@ -1145,7 +1147,7 @@ class CompanyStatementController extends ThinkController } $secord_info['id'] = $weCompany['id']; - $secord_info['partner'] =$weCompany['company_name']; + $secord_info['partner'] =$weCompany['partner']; $secord_info['link_man'] = $weCompany['link_man']; $secord_info['link_phone'] =$weCompany['link_phone']; $secord_info['address'] = $weCompany['address']; @@ -1166,27 +1168,49 @@ class CompanyStatementController extends ThinkController $statement_money += $v['sum_money']; } + $insert['pay_amount'] = $pay_amount; $insert['platform_amount'] = $pay_amount; $insert['statement_money'] = $statement_money; - + $insert['op_time'] = time(); if ($company_type['first_company_id'] == $value['company_id']) { + $insert['first_party_info'] = json_encode($proCompany_info); + $insert['second_party_info'] = json_encode($secord_info); + } elseif ($company_type['second_company_id'] == $value['company_id']) { + $insert['second_party_info'] = json_encode($proCompany_info); + $insert['first_party_info'] = json_encode($secord_info); + } + foreach($statement_info as $k => $v) { + $statement_info[$k]['statement_type'] = 0; + $statement_info[$k]['fax_ratio'] = $company_data['fax_ratio']; + } - } elseif ($company_type['second_company_id'] == $value['company_id']) { + if ($company_data['company_type'] == 2) { + $statement_data['account'] = ''; + $statement_data['game_list'] = $statement_info; + $insert['statement_info'] = json_encode($statement_data); + } else { + $insert['statement_info'] = json_encode($statement_info); } + $is_save = M('company_statement','tab_')->add($insert); - } + if (!$is_save) { + M()->rollback(); + $this->ajaxReturn(['status'=>1001]); + } - dump($data); + } + M()->commit(); + $this->ajaxReturn(['status'=>1]); } diff --git a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html index 01a63a19c..dc83c0ae4 100644 --- a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html +++ b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html @@ -308,8 +308,12 @@ dataType: 'json', data: {data:JSON.stringify(send)}, success: function(result) { - - + if (result.status == 1) { + layer.msg("插入成功"); + parent.location.reload() + } elseif (result.status==1001) { + layer.msg("数据插入失败"); + } }}); } else {