|
|
@ -307,12 +307,16 @@ class ExcelPaymentController extends BaseController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function getAccountMoney(){
|
|
|
|
public function getAccountMoney(){
|
|
|
|
Vendor("Alipay2020/Fund");
|
|
|
|
Vendor("Alipay2020/Fund");
|
|
|
|
$fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
if(empty(C("ALI_PAYMENT"))){
|
|
|
|
$money = $fund->account();
|
|
|
|
$money = "测试站无法查看";
|
|
|
|
if($money !== -1){
|
|
|
|
|
|
|
|
$money = $money['amount'];
|
|
|
|
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$money = "--";
|
|
|
|
$fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
|
|
|
|
$money = $fund->account();
|
|
|
|
|
|
|
|
if($money !== -1){
|
|
|
|
|
|
|
|
$money = $money['amount'];
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$money = "--";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->assign("money",$money);
|
|
|
|
$this->assign("money",$money);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -331,41 +335,44 @@ class ExcelPaymentController extends BaseController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
$remark = $_REQUEST['remark'];
|
|
|
|
$remark = $_REQUEST['remark'];
|
|
|
|
|
|
|
|
if (empty(C("ALI_PAYMENT"))) {
|
|
|
|
|
|
|
|
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>[]]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Vendor("Alipay2020/Fund");
|
|
|
|
Vendor("Alipay2020/Fund");
|
|
|
|
$fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
$fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
|
|
|
|
$dbres = M("ExcelStatementInfo", "tab_")->where("id='{$id}'")->find();
|
|
|
|
$dbres = M("ExcelStatementInfo","tab_")->where("id='{$id}'")->find();
|
|
|
|
$company_info = json_decode($dbres['company_info'], true);
|
|
|
|
$company_info = json_decode($dbres['company_info'],true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($dbres['pay_status'] != 1){
|
|
|
|
if ($dbres['pay_status'] != 1) {
|
|
|
|
//执行打款
|
|
|
|
//执行打款
|
|
|
|
$title = $remark;
|
|
|
|
$title = $remark;
|
|
|
|
$amount = $dbres['statement_money'];
|
|
|
|
$amount = $dbres['statement_money'];
|
|
|
|
$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;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$savedata["pay_status"]=-1;
|
|
|
|
$savedata["pay_status"]=-1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$payres = json_decode( json_encode($payres),true);
|
|
|
|
$payres = json_decode(json_encode($payres), true);
|
|
|
|
$payres["remark"] = $remark;
|
|
|
|
$payres["remark"] = $remark;
|
|
|
|
|
|
|
|
|
|
|
|
$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 = [
|
|
|
|
$pu = [
|
|
|
|
"mobile"=>$this->admininfo['mobile'],
|
|
|
|
"mobile"=>$this->admininfo['mobile'],
|
|
|
|
"real_name"=>$this->admininfo['real_name'],
|
|
|
|
"real_name"=>$this->admininfo['real_name'],
|
|
|
|
"time"=>date("Y-m-d H:i:s")
|
|
|
|
"time"=>date("Y-m-d H:i:s")
|
|
|
|
];
|
|
|
|
];
|
|
|
|
$savedata['payment_user'] = json_encode($pu,JSON_UNESCAPED_UNICODE);
|
|
|
|
$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"=>[]]);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 打款详情
|
|
|
|
* 打款详情
|
|
|
|