|
|
|
@ -884,9 +884,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"=>[]]);
|
|
|
|
|
}
|
|
|
|
|
//执行打款
|
|
|
|
@ -895,11 +895,11 @@ class PaymentController extends BaseController
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
|
|
|
|
|
$remark = $_REQUEST['remark'];
|
|
|
|
|
// if(empty(C("ALI_PAYMENT"))){
|
|
|
|
|
// $this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>["status"=>0]]);
|
|
|
|
|
// }
|
|
|
|
|
// Vendor("Alipay2020/Fund");
|
|
|
|
|
// $fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
|
if(empty(C("ALI_PAYMENT"))){
|
|
|
|
|
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>["status"=>0]]);
|
|
|
|
|
}
|
|
|
|
|
Vendor("Alipay2020/Fund");
|
|
|
|
|
$fund = new \Fund(C("ALI_PAYMENT"));
|
|
|
|
|
$dbres = M("pay_statement_info", "tab_")->where("id='{$id}'")->find();
|
|
|
|
|
|
|
|
|
|
$company_info = json_decode($dbres['company_info'], true);
|
|
|
|
@ -907,13 +907,13 @@ class PaymentController extends BaseController
|
|
|
|
|
//执行打款
|
|
|
|
|
$title = "信息服务费";
|
|
|
|
|
$amount = $dbres['statement_money'];
|
|
|
|
|
// $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
|
|
|
|
|
// $resultCode = $payres->code;
|
|
|
|
|
$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;
|
|
|
|
|
$savedata["pay_status"]=-1;
|
|
|
|
|
}
|
|
|
|
|
$payres = json_decode(json_encode($payres), true);
|
|
|
|
|
$payres["remark"] = $remark;
|
|
|
|
@ -923,7 +923,6 @@ class PaymentController extends BaseController
|
|
|
|
|
$savedata["pay_time"]=time();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M("pay_statement_info","tab_")->save($savedata);
|
|
|
|
|
|
|
|
|
|
if ($savedata["pay_status"] == -1) {
|
|
|
|
@ -1052,12 +1051,11 @@ class PaymentController extends BaseController
|
|
|
|
|
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
|
|
|
|
|
$data = M("pay_statement_info","tab_")
|
|
|
|
|
$data = M("company_statement_info","tab_")
|
|
|
|
|
->field("id,statement_money,company_name,statement_begin_time,statement_end_time,pay_time")
|
|
|
|
|
->where(['id'=>['in',$ids]])
|
|
|
|
|
->where(['id'=>['in',implode(',',$ids)]])
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// dump($data);die();
|
|
|
|
|
$return = [];
|
|
|
|
|
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
@ -1073,13 +1071,14 @@ class PaymentController extends BaseController
|
|
|
|
|
])
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$check_company_statement_info = M("pay_statement_info","tab_")
|
|
|
|
|
$check_company_statement_info = M("company_statement_info","tab_")
|
|
|
|
|
->where([
|
|
|
|
|
'pay_status'=>1,
|
|
|
|
|
'company_name'=>$value['company_name'],
|
|
|
|
|
'statement_begin_time'=>$value['statement_begin_time'],
|
|
|
|
|
'statement_end_time'=>$value['statement_end_time'],
|
|
|
|
|
'statement_money'=>$value['statement_money'],
|
|
|
|
|
'id'=>['neq',$value['id']],
|
|
|
|
|
])
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|