|
|
|
@ -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...
|
|
|
|
|
}
|
|
|
|
|