|
|
|
@ -642,9 +642,9 @@ class PaymentController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
$mobile = $this->admininfo['mobile'];
|
|
|
|
|
$verify = $_REQUEST['verify'];
|
|
|
|
|
if (!A("Public")->checksafecode($mobile, $verify)) {
|
|
|
|
|
$this->ajaxReturn(["error"=>"验证码错误"]);
|
|
|
|
|
}
|
|
|
|
|
// if (!A("Public")->checksafecode($mobile, $verify)) {
|
|
|
|
|
// $this->ajaxReturn(["error"=>"验证码错误"]);
|
|
|
|
|
// }
|
|
|
|
|
$this->ajaxReturn(["success"=>"验证码验证成功","data"=>[]]);
|
|
|
|
|
}
|
|
|
|
|
//执行打款
|
|
|
|
@ -656,33 +656,38 @@ class PaymentController extends BaseController
|
|
|
|
|
|
|
|
|
|
$remark = $_REQUEST['remark'];
|
|
|
|
|
if(empty(C("ALI_PAYMENT"))){
|
|
|
|
|
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>[]]);
|
|
|
|
|
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>["status"=>0]]);
|
|
|
|
|
}
|
|
|
|
|
Vendor("Alipay2020/Fund");
|
|
|
|
|
$fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
|
// Vendor("Alipay2020/Fund");
|
|
|
|
|
// $fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
|
$dbres = M("company_statement_info", "tab_")->where("id='{$id}'")->find();
|
|
|
|
|
$company_info = json_decode($dbres['company_info'], true);
|
|
|
|
|
if ($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1) {
|
|
|
|
|
//执行打款
|
|
|
|
|
$title = "信息服务费";
|
|
|
|
|
$amount = $dbres['statement_money'];
|
|
|
|
|
$payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
|
|
|
|
|
$resultCode = $payres->code;
|
|
|
|
|
$savedata = ["id"=>$dbres['id']];
|
|
|
|
|
// $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;
|
|
|
|
|
// $payres = json_decode(json_encode($payres), true);
|
|
|
|
|
// $payres["remark"] = $remark;
|
|
|
|
|
//
|
|
|
|
|
// $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
// $savedata["pay_type"]=2;
|
|
|
|
|
// $savedata["pay_time"]=time();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
$savedata["pay_type"]=2;
|
|
|
|
|
$savedata["pay_time"]=time();
|
|
|
|
|
if ($savedata["pay_status"] == -1) {
|
|
|
|
|
$this->ajaxReturn(["success"=>"打款成功","data"=>["status"=>0]]);
|
|
|
|
|
}
|
|
|
|
|
M("company_statement_info","tab_")->save($savedata);
|
|
|
|
|
$this->ajaxReturn(["success"=>"打款成功","data"=>[]]);
|
|
|
|
|
|
|
|
|
|
// M("company_statement_info","tab_")->save($savedata);
|
|
|
|
|
$this->ajaxReturn(["success"=>"打款成功","data"=>["status"=>1]]);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 执行最后聚合表统计
|
|
|
|
|