From 4e2934d1e8c7a3e93fd4d1eeff33d72ea785b93d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 17 Jun 2020 18:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=93=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PaymentController.class.php | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index 2c14aa8a1..d8fbfc593 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -430,17 +430,33 @@ class PaymentController extends BaseController // $dbres = M("company_statement_info","tab_")->where("id='{$id}'")->find(); - $dbres['company_info'] = json_decode($v['company_info'],true); + $company_info = json_decode($dbres['company_info'],true); //TODO:未进行真实打款 if($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1){ //执行打款 - // $payres = json_decode( json_encode( $object),true); + $title = "测试-".$dbres['company_name']."结算"; + $amount = $dbres['statement_money']; + $amount = 0.1;//测试金额为0 + $payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title); + $resultCode = $payres->code; + + + $savedata = ["id"=>$dbres['id']]; + if(!empty($resultCode)&&$resultCode == 10000){ + $savedata["pay_status"]=1; + } else { + $savedata["pay_status"]=-1; + } + + $payres = json_decode( json_encode($payres),true); $payres["remark"] = $remark; - $dbres["payinfo"] = json_encode($payres,JSON_UNESCAPED_UNICODE); - $dbres["pay_status"]=1; - $dbres["pay_type"]=2; + + $savedata["pay_info"] = json_encode($payres,JSON_UNESCAPED_UNICODE); + $savedata["pay_type"]=2; + $savedata["pay_time"]=time(); + } - M("company_statement_info","tab_")->save($dbres); + M("company_statement_info","tab_")->save($savedata); $this->ajaxReturn(["success"=>"打款成功","data"=>[]]); # code... }