增加同步支付统计过程调用

hotfix/paypal-note
LiaoYijun 4 years ago
parent 8d3efced56
commit f95ed13983

@ -50,6 +50,7 @@ class AlipayTradeService extends CI_Controller
$this->load->model('AlipayTradeQueryContentBuilder'); $this->load->model('AlipayTradeQueryContentBuilder');
$this->load->model('Alipay_note_model'); $this->load->model('Alipay_note_model');
$this->load->model('Alipay_model'); $this->load->model('Alipay_model');
$this->load->model('Group_model');
$this->load->helper('payment'); $this->load->helper('payment');
$this->load->model('Online_payment_account_model', 'payment_model'); $this->load->model('Online_payment_account_model', 'payment_model');
@ -326,6 +327,14 @@ class AlipayTradeService extends CI_Controller
return $result; return $result;
} }
// https://www.mycht.cn/webht.php/apps/pay/AlipayTradeService/test_new_function?coli_sn=962702
public function test_new_function() {
echo 'test_new_function';
$coli_sn = $this->input->get('coli_sn');
$this->Group_model->update_ck_group_info($coli_sn);
echo 'update_ck_group_info';
}
/*! /*!
* 定时执行 * 定时执行
* 处理异步通知: 解析订单号, 邮件外联/客人; 插入付款记录 * 处理异步通知: 解析订单号, 邮件外联/客人; 插入付款记录
@ -407,6 +416,10 @@ class AlipayTradeService extends CI_Controller
//添加支付信息入库 //添加支付信息入库
//没有分配订单之前先添加付款记录,这个过程可能会执行多次,必须在添加记录前查找是否有数据 //没有分配订单之前先添加付款记录,这个过程可能会执行多次,必须在添加记录前查找是否有数据
if (!empty($orderid_info)) { if (!empty($orderid_info)) {
//
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
$this->Group_model->update_ck_group_info($GAI_COLI_SN);
$currencyCode = str_replace("CNY", "RMB", trim(mb_strtoupper($item->ALI_currencyCode))); $currencyCode = str_replace("CNY", "RMB", trim(mb_strtoupper($item->ALI_currencyCode)));
$ssje = $item->ALI_orderAmount; $ssje = $item->ALI_orderAmount;
if (intval($item->ALI_stateCode)!==1) { if (intval($item->ALI_stateCode)!==1) {
@ -417,7 +430,6 @@ class AlipayTradeService extends CI_Controller
//更新还没有填的客邮和交易号de收款记录商务订单 //更新还没有填的客邮和交易号de收款记录商务订单
if (isset($advisor_info->order_type) && $advisor_info->order_type == 0) { if (isset($advisor_info->order_type) && $advisor_info->order_type == 0) {
$ht_memo = '交易号(自动录入):' . $item->ALI_dealId; $ht_memo = '交易号(自动录入):' . $item->ALI_dealId;
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
//CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断 //CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") != '-biz') { if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") != '-biz') {
//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单 //只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单

@ -16,6 +16,7 @@ class PaymentService extends CI_Controller {
$this->load->library('alipay_call'); $this->load->library('alipay_call');
$this->load->model('Online_payment_note_model', 'note_model'); $this->load->model('Online_payment_note_model', 'note_model');
$this->load->model('Online_payment_account_model', 'account_model'); $this->load->model('Online_payment_account_model', 'account_model');
$this->load->model('Group_model');
} }
private $code_brandname = array( private $code_brandname = array(
@ -155,6 +156,7 @@ class PaymentService extends CI_Controller {
continue; continue;
} }
$COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0; $COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
$this->Group_model->update_ck_group_info($COLI_SN);
$update_note_column = array(); $update_note_column = array();
if ($advisor_info->order_type == 0) { if ($advisor_info->order_type == 0) {
/* 商务订单 */ /* 商务订单 */

@ -0,0 +1,36 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Group_model extends CI_Model {
private $HT;
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
public function update_ck_group_info($COLI_SN)
{
$group_sn_query =
"select COLI_GRI_SN from ConfirmLineInfo where COLI_SN=?
union
select COLI_GRI_SN from BIZ_ConfirmLineInfo where COLI_SN=?";
$group_sn_row = $this->HT->query($group_sn_query, array($COLI_SN, $COLI_SN))->row();
var_dump($group_sn_row);
if (!empty($group_sn_row) && $group_sn_row->COLI_GRI_SN > 0) {
$group_sn = $group_sn_row->COLI_GRI_SN;
$check_group_query = "select CGI_SN from CK_GroupInfo where CGI_GRI_SN=?";
$check_group_row = $this->HT->query($check_group_query, array($group_sn))->row();
var_dump($check_group_row);
if (empty($check_group_row)) {
$update_group_query = "exec SP_CheckGroup_UpdateCKGroupInfo(?, 29)";
// $update_group_row = $this->HT->query($update_group_query, array($group_sn));
}
}
}
}

@ -10,6 +10,7 @@ class Index extends CI_Controller {
// $this->output->enable_profiler(TRUE); // $this->output->enable_profiler(TRUE);
$this->load->model('Paypal_model'); $this->load->model('Paypal_model');
$this->load->model('Note_model'); $this->load->model('Note_model');
$this->load->model('Group_model');
bcscale(2); bcscale(2);
} }
@ -933,10 +934,11 @@ class Index extends CI_Controller {
$ssje = $this->Paypal_model->get_ssje($item->pn_mc_gross, '15002', mb_strtoupper($item->pn_mc_currency)); $ssje = $this->Paypal_model->get_ssje($item->pn_mc_gross, '15002', mb_strtoupper($item->pn_mc_currency));
$ssje = $old_ssje===NULL ? $ssje : $old_ssje; $ssje = $old_ssje===NULL ? $ssje : $old_ssje;
$USD_amount = $this->Paypal_model->get_USD($item->pn_mc_gross, $item->pn_mc_currency); $USD_amount = $this->Paypal_model->get_USD($item->pn_mc_gross, $item->pn_mc_currency);
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
$this->Group_model->update_ck_group_info($GAI_COLI_SN);
//更新还没有填的客邮和交易号de收款记录商务订单 //更新还没有填的客邮和交易号de收款记录商务订单
if (isset($advisor_info->order_type) && $advisor_info->order_type == 0) { if (isset($advisor_info->order_type) && $advisor_info->order_type == 0) {
$ht_memo = '交易号(自动录入):' . $item->pn_txn_id; $ht_memo = '交易号(自动录入):' . $item->pn_txn_id;
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
//CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断 //CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") !== '-biz') {//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单 if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") !== '-biz') {//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单
$this->Paypal_model->add_account_info_forAPP($GAI_COLI_SN, $advisor_info->COLI_ID, $item->pn_mc_gross, $item->pn_payment_date, mb_strtoupper($item->pn_mc_currency), $ssje, $item->pn_payment_date, $item->pn_payment_date, $item->pn_payment_date, $item->pn_payer, $item->pn_payer_email, $item->pn_txn_id, $ht_memo); $this->Paypal_model->add_account_info_forAPP($GAI_COLI_SN, $advisor_info->COLI_ID, $item->pn_mc_gross, $item->pn_payment_date, mb_strtoupper($item->pn_mc_currency), $ssje, $item->pn_payment_date, $item->pn_payment_date, $item->pn_payment_date, $item->pn_payer, $item->pn_payer_email, $item->pn_txn_id, $ht_memo);

Loading…
Cancel
Save