优化打款记录

master
chenzhi 4 years ago
parent b460b7409f
commit 52b1168930

@ -145,6 +145,13 @@ class ExcelPaymentController extends BaseController
$v['company_type'] = 2; $v['company_type'] = 2;
$v['create_time'] = time(); $v['create_time'] = time();
$v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5); $v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5);
$dm = [
"mobile"=>$this->admininfo['mobile'],
"real_name"=>$this->admininfo['real_name'],
"time"=>date("Y-m-d H:i:s")
];
$v['document_maker'] = json_encode($dm,JSON_UNESCAPED_UNICODE);
if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){ if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){
M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete(); M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"支付宝真实姓名及登陆账号不允许为空"]); $this->ajaxReturn(["status"=>0,"msg"=>"支付宝真实姓名及登陆账号不允许为空"]);
@ -312,11 +319,10 @@ class ExcelPaymentController extends BaseController
//执行打款 //执行打款
$title = $remark; $title = $remark;
$amount = $dbres['statement_money']; $amount = $dbres['statement_money'];
$amount = 0.1; $amount = 0.1; //测试金额必须去除
$payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title); $payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title);
$resultCode = $payres->code; $resultCode = $payres->code;
$savedata = ["id"=>$dbres['id']]; $savedata = ["id"=>$dbres['id']];
if(!empty($resultCode)&&$resultCode == 10000){ if(!empty($resultCode)&&$resultCode == 10000){
$savedata["pay_status"]=1; $savedata["pay_status"]=1;
@ -329,6 +335,12 @@ class ExcelPaymentController extends BaseController
$savedata["pay_info"] = json_encode($payres,JSON_UNESCAPED_UNICODE); $savedata["pay_info"] = json_encode($payres,JSON_UNESCAPED_UNICODE);
$savedata["pay_time"]=time(); $savedata["pay_time"]=time();
$pu = [
"mobile"=>$this->admininfo['mobile'],
"real_name"=>$this->admininfo['real_name'],
"time"=>date("Y-m-d H:i:s")
];
$savedata['payment_user'] = json_encode($pu,JSON_UNESCAPED_UNICODE);
} }
M("ExcelStatementInfo","tab_")->save($savedata); M("ExcelStatementInfo","tab_")->save($savedata);
$this->ajaxReturn(["success"=>"打款成功","data"=>[]]); $this->ajaxReturn(["success"=>"打款成功","data"=>[]]);

@ -2092,11 +2092,12 @@ CREATE TABLE `tab_excel_statement_info` (
`statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间', `statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间',
`statement_num` varchar(500) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '结算单号', `statement_num` varchar(500) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '结算单号',
`statement_info` text NOT NULL COMMENT '订单相关信息json', `statement_info` text NOT NULL COMMENT '订单相关信息json',
`pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款状态 -1:打款失败 0:未打款 1:打款成功', `pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款状态 -1:打款失败 0:未打款 1:打款成功',
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付完成时间', `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付完成时间',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '生成时间', `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '生成时间',
`pay_info` text COMMENT '打款信息', `pay_info` text COMMENT '打款信息',
`document_maker` varchar(255) DEFAULT '' COMMENT '制单信息',
`payment_user` varchar(255) DEFAULT '' COMMENT '打款基础信息',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注', `remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `batch_num` (`batch_num`) USING BTREE, KEY `batch_num` (`batch_num`) USING BTREE,

Loading…
Cancel
Save