79 lines
2.1 KiB
PHP
79 lines
2.1 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: lcc
|
|
* Date: 2021/09/02
|
|
* Time: 17:45
|
|
*/
|
|
class Profinish extends HD_Controller
|
|
{
|
|
private $log_file = 'profinish.log';
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$this->data['log_file'] = $this->log_file;
|
|
$this->data['_title'] = '结束分账';
|
|
return $this->show_view('app/profinish',true);
|
|
}
|
|
|
|
public function lists()
|
|
{
|
|
}
|
|
|
|
public function get()
|
|
{
|
|
}
|
|
|
|
|
|
public function add()
|
|
{
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
require_once COMMPATH."../api/third_party/WXconfig/1612096731.Config.php";
|
|
require_once COMMPATH."../api/third_party/WXpay/WxPay.Api.php";
|
|
$transaction_id = $this->input->post('transaction_id');
|
|
$description = $this->input->post('description');
|
|
if(!$transaction_id || !$description){
|
|
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
|
}
|
|
$this->load->helper('order');
|
|
$out_order_no = create_order_no();
|
|
$config = new WxPayConfig();
|
|
$wxpay = new WxPayProfitSharingFinish();
|
|
$wxpay -> SetTransaction_id($transaction_id);
|
|
$wxpay -> SetOut_order_no($out_order_no);
|
|
$wxpay -> SetDescription($description);
|
|
$return = WxPayApi::profitsharingfinish($config, $wxpay);
|
|
debug_log("[结束分账返回参数]:" .json_encode($return,JSON_UNESCAPED_UNICODE), $this->log_file,'wxapi');
|
|
if($return['result_code'] == 'SUCCESS') {
|
|
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
|
}else{
|
|
$err_msg = $return['return_msg'] ? $return['return_msg'] : $return['return_msg'].$return['err_code_des'];
|
|
return $this->show_json(SYS_CODE_FAIL, '错误信息:'.$err_msg);
|
|
}
|
|
}
|
|
|
|
|
|
public function del()
|
|
{
|
|
}
|
|
|
|
public function batch()
|
|
{
|
|
// TODO: Implement batch() method.
|
|
}
|
|
|
|
public function export()
|
|
{
|
|
// TODO: Implement export() method.
|
|
}
|
|
}
|