perf: APP组退款记录录入后补充记录: 录入`我的支付`

webht/payment
Lei OT 3 months ago
parent 3d4a2bdea4
commit 99c4d6743a

@ -624,7 +624,7 @@ class AlipayTradeService extends CI_Controller
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
//CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") != '-biz') {//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单
$this->Alipay_model->add_account_info_forAPP(
$is_insert = $this->Alipay_model->add_account_info_forAPP(
$GAI_COLI_SN,
$advisor_info->COLI_ID,
$item->ALI_orderAmount,
@ -638,7 +638,12 @@ class AlipayTradeService extends CI_Controller
NULL,
$item->ALI_dealId,
$ht_memo);
if ($is_insert) {
$this->Alipay_model->insert_biz_order_log($GAI_COLI_SN, 'Refunded');
$this->payment_model->exec_BIZ_TrainCostAdd($GAI_COLI_SN, $ssje);
}
} else {
if (false == $this->Alipay_model->if_biz_gai_exists($item->ALI_dealId) ) {
$this->Alipay_model->insert_biz_order_log($GAI_COLI_SN, 'Refunded');

@ -202,7 +202,7 @@ class PaymentService extends CI_Controller {
// todo: 检测收/退款是否存在
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") !== '-biz') {
/* APP */
$this->account_model->add_account_info_forAPP(
$is_insert = $this->account_model->add_account_info_forAPP(
$COLI_SN,
$item->OPN_accountMethod,
$advisor_info->COLI_ID,
@ -218,6 +218,9 @@ class PaymentService extends CI_Controller {
$item->OPN_transactionId,
$ht_memo
);
if ($is_refund === true && $is_insert) {
$this->account_model->exec_BIZ_TrainCostAdd($COLI_SN, $ssje);
}
if ($advisor_info->COLI_WebCode == 'CHTAPP' && $advisor_info->COLI_State == 11
&& false===$is_refund) {
//只修改APP组的订单状态并且订单进度是我的订单

@ -204,8 +204,15 @@ class Alipay_model extends CI_Model {
,DeleteFlag
) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,?,0,0)";
$query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query;
// $insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
// return $query;
return $query->num_rows() > 0;
// affected_rows() doesn't work with the 'sqlsrv' driver in CI2
// The solution: Upgrade to the latest CodeIgniter 3.0.x version
// $ssql = "SELECT 1 as 'exist' from BIZ_GroupAccountInfo where GAI_AccreditNo=? ";
// $squery = $this->HT->query($ssql, array($GAI_AccreditNo));
// $ret = $squery->result();
// return !empty($ret);
}
//添加收款记录(商务订单)

@ -308,8 +308,15 @@ class Online_payment_account_model extends CI_Model {
,DeleteFlag,LastEditTime
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $payment_method, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query;
// $insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
// return $query;
return $query->num_rows() > 0;
// affected_rows() doesn't work with the 'sqlsrv' driver in CI2
// The solution: Upgrade to the latest CodeIgniter 3.0.x version
// $ssql = "SELECT 1 as 'exist' from BIZ_GroupAccountInfo where GAI_AccreditNo=? ";
// $squery = $this->HT->query($ssql, array($GAI_AccreditNo));
// $ret = $squery->result();
// return !empty($ret);
}
//添加收款记录(传统订单)
@ -369,6 +376,17 @@ class Online_payment_account_model extends CI_Model {
return $query;
}
/**
* QQS: APP组退款之后执行
* 插入数据到“我的支付”
**/
public function exec_BIZ_TrainCostAdd($COLI_SN, $ssje)
{
$sql = " EXEC dbo.SP_BIZ_TrainCostAdd $COLI_SN, $ssje ";
$query = $this->HT->query($sql);
return $query;
}
public function save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo = '', $M_State = 0, $M_AddTime = '', $frominfo = 'paypal msg', $M_Web = 'paypal msg') {
$sql = "INSERT INTO
Email_AutomaticSend (

@ -221,8 +221,17 @@ class Paypal_model extends CI_Model {
,DeleteFlag,LastEditTime
) VALUES (?,?,15010,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo,$GAI_API));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query;
// $insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
log_message('error','test:$query ' . __METHOD__ . ': ' . __LINE__ . PHP_EOL . var_export($query->num_rows(), 1));
return $query->num_rows() > 0;
// affected_rows() doesn't work with the 'sqlsrv' driver in CI2
// The solution: Upgrade to the latest CodeIgniter 3.0.x version
// $ssql = "SELECT 1 as 'exist' from BIZ_GroupAccountInfo where GAI_AccreditNo=? ";
// $squery = $this->HT->query($ssql, array($GAI_AccreditNo));
// $ret = $squery->result();
// log_message('error','test: empty insert ' . __METHOD__ . ': ' . __LINE__ . PHP_EOL . var_export((!empty($ret)), 1));
// return !empty($ret);
}
//添加收款记录(商务订单)
@ -659,6 +668,17 @@ class Paypal_model extends CI_Model {
return $query;
}
/**
* QQS: APP组退款之后执行
* 插入数据到“我的支付”
**/
public function exec_BIZ_TrainCostAdd($COLI_SN, $ssje)
{
$sql = " EXEC dbo.SP_BIZ_TrainCostAdd $COLI_SN, $ssje ";
$query = $this->HT->query($sql);
return $query;
}
/** 写入商务订单操作记录 */
public function insert_biz_order_log($coli_sn, $log_info)
{

Loading…
Cancel
Save